Currently in the process of designing a website, I am faced with a challenging issue that seems to have me stumped. The structure of my page consists entirely of HTML DIVs, with certain elements nested within their parent DIVs. My main dilemma lies in trying to position a banner-wrap DIV directly underneath the DIV containing my navigation menu without any spacing between them. However, despite numerous attempts, I have yet to discover a solution to eliminate this unwanted space.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<body class='landing-page wsite-theme-light'>
<div id="nav-mast">
<div class="container">
<table>
<tr>
<td id="logo">{logo}</td>
<td id="nav">{menu}</td>
</tr>
</table><!-- end navigation table -->
</div><!-- end nav bar contanier -->
</div><!-- end navigation mast -->
<div id="landing-wrap">
<div class="container">
<div id="banner">
<div class="wsite-header"></div>
</div><!-- end banner -->
<div id="banner-social-screen">
<h3>Contact</h3>
{social}
</div><!-- end banner social screen -->
<div id="banner-screen">
<div class="banner-screen-inner">
<div class="banner-screen-content">
<h2>{headline:text global="false"}</h2>
<p>{headline-paragraph:text global="false"}</p>
<div id="landing-button">{action:button global="false"}</div>
</div><!-- end banner screen content -->
</div><!-- end inner banner screen -->
</div><!-- end banner screen -->
</div><!-- end landing container -->
</div><!-- end landing wrap -->
The nav-mast div serves as the navigation bar, and the gap occurs between the nav-mast DIV and the landing-wrap DIV. The landing-wrap holds an image header featuring two semi-transparent elements residing in the banner-screen and banner-social-screen DIVs. The banner-social-screen contains an h3 text element along with social icons for the website. On the other hand, the banner-screen comprises an h2 text element showcasing the landing page's headline and a p text element representing the paragraph-headline. While both the banner-social-screen and banner-screen elements are correctly positioned on top of the image, the problematic spacing emerges between the bottom of the nav-mast element and the top of the landing-wrap element.
This is my current CSS which results in a space (image in link):
.landing-page #banner-screen {
position: relative;
display: block;
vertical-align: middle;
margin-left: auto;
margin-right: auto;
width: 80%;
height: auto;
background: rgba(176, 176, 176, 0.70);
}
.landing-page #landing-wrap {
background-image: url(banner-tall.jpg);
height: 500px;
margin-bottom: 30px;
margin-top: 0px;
background-repeat: no-repeat;
background-position: center center;
width: 100%;
background-size: cover;
-webkit-box-shadow: 7px 7px 22px 0px rgba(50, 50, 50, 0.7);
-moz-box-shadow: 7px 7px 22px 0px rgba(50, 50, 50, 0.7);
box-shadow: 7px 7px 22px 0px rgba(50, 50, 50, 0.7);
-webkit-box-shadow: -7px 7px 22px 0px rgba(50, 50, 50, 0.7);
-moz-box-shadow: -7px 7px 22px 0px rgba(50, 50, 50, 0.7);
box-shadow: -7px 7px 22px 0px rgba(50, 50, 50, 0.7);
}
.landing-page .banner-screen-content h2 {
top: 15px;
left: 10px;
font-family: 'Sansation', sans-serif;
font-size: 24px;
line-height: 10px;
text-align: center;
position: relative;
}
.landing-page .banner-screen-content p {
font-family: 'Playfair Display', serif;
font-size: 14px;
top: 0px;
line-height: 14px;
left: 10px;
text-align: left;
position: relative;
word-wrap: normal;
}
.landing-page #banner-social-screen {
position: relative;
display: block;
vertical-align: middle;
margin-left: auto;
margin-right: 0%;
margin-top: 0%;
width: 20%;
height: auto;
background: rgba(176, 176, 176, 0.70);
}
.landing-page #banner-social-screen h3 {
top: 5px;
left: 3px;
font-family: 'Sansation', sans-serif;
font-size: 18px;
line-height: 8px;
text-align: center;
position: relative;
}
This is what my CSS looked like before the appearance of the space (image in link):
.landing-page #banner-screen {
position: relative;
display: block;
vertical-align: middle;
margin-left: auto;
margin-right: auto;
width: 80%;
height: auto;
background: rgba(176, 176, 176, 0.70);
}
.landing-page #landing-wrap {
background-image: url(banner-tall.jpg);
height: 500px;
margin-bottom: 30px;
background-repeat: no-repeat;
background-position: center center;
width: 100%;
background-size: cover;
-webkit-box-shadow: 7px 7px 22px 0px rgba(50, 50, 50, 0.7);
-moz-box-shadow: 7px 7px 22px 0px rgba(50, 50, 50, 0.7);
box-shadow: 7px 7px 22px 0px rgba(50, 50, 50, 0.7);
-webkit-box-shadow: -7px 7px 22px 0px rgba(50, 50, 50, 0.7);
-moz-box-shadow: -7px 7px 22px 0px rgba(50, 50, 50, 0.7);
box-shadow: -7px 7px 22px 0px rgba(50, 50, 50, 0.7);
}
.landing-page .banner-screen-content h2 {
top: 15px;
left: 10px;
font-family: 'Sansation', sans-serif;
font-size: 24px;
line-height: 10px;
text-align: center;
position: relative;
}
.landing-page .banner-screen-content p {
font-family: 'Playfair Display', serif;
font-size: 14px;
top: 0px;
line-height: 14px;
left: 10px;
text-align: left;
position: relative;
word-wrap: normal;
}
.landing-page #banner-social-screen {
text-align: right;
display: inline-block;
height: auto;
width: auto;
margin-bottom: 0px;
margin-right: 0px;
background: rgba(176, 176, 176, 0.70);
position: relative;
}
.landing-page #banner-social-screen h3 {
top: 5px;
left: 3px;
font-family: 'Sansation', sans-serif;
font-size: 18px;
line-height: 8px;
text-align: center;
position: relative;
}
The downfall of using the display as inline-block was the inability to properly position the banner-social-screen element.
Thus, my query revolves around discovering a way to eradicate the space between the nav-mast and landing-wrap elements while retaining the presence of the banner-screen and banner-social blocks on my webpage.