Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

gap between divs...

Status
Not open for further replies.

rrmcguire

Programmer
Oct 13, 2010
304
US
I have a gap between my navigation and my banner divs in the below code which seems to be fixed using overflow:hidden in my CSS for banner, but then the background image of my banner is then off...the URL is
here's the HTML

<body bgcolor="#999966" background="images/test background.png">
<div id="navigation">
<p>Content for id "navigation" Goes Here</p>
</div navigation>
<div id="banner">
<div id="bannertext">
<p>&nbsp;</p>
<p>A FRESH NEW LOOK AT TRANSPORTATION</p>
</div bannertext>
<div id="bannertext2"> &quot;No Bad Deals&quot;</div bannertext2>

<div id="bannertext3">
<h2 class="bold">Welcome to Our Website </h2>
<p>With over two decades of service, Meadow Lark has offered innovative solutions to any transportation need with on-demand operation services and advanced technology. Customers, Contractors, and agents alike benefit from association with our company. Family owned and operated, Meadow Lark is the premier choice for your shipping requirements.</p>
<p>&nbsp;</p>
</div bannertext3>
</div banner>


<div id="content">Content for id "content" Goes Here</div>

<div id="footer">Content for id "footer" Goes Here</div>
</body>
</html>


Here's the CSS:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Meadow Lark Agency</title>
<style type="text/css">
<!--
body {
background-color: #999966;
background-image: url(images/test%20background.png);

}
#banner {
background-image: url(images/gettycropped2.png);
width: 900px;
margin: auto;
height: 400px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
#banner #bannertext3 {
text-align: right;
padding-right: 50px;
color: #FFF;
vertical-align: top;
padding-left: 425px;
}
#banner #bannertext {
text-align: right;
padding-left: 300px;
color: #FFF;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
padding-right: 10px;
font-size: 24px;
}
#banner #bannertext2 {
text-align: right;
color: #FFF;
padding-right: 200px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 16px;
padding-top: 0px;
}
#navigation {
margin: auto;
width: 900px;
background-image: url(images/testbanner2.png);
background-repeat: no-repeat;
height: 100px;

}
#content {
margin: auto;
width: 900px;
}
#footer {
margin: auto;
width: 900px;
}
.bold {
font-weight: bold;
}
-->
</style>
</head>


any help would be appreciated

thanks
 
when I view it in firefox with the overflow:hidden attribute is when the background is off, in IE7 its fine.
 
I don't see the separation in FF4 in the link you provided. Though if you were to make the div taller you would potentially see a gap, because your background won't cover it.

Also if you were to add any sort of padding to it, there might be a separation, because the image is just 100px high, anything more and the picture won't cover it.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top