Forum Moderators: not2easy
There is a div which contains two images that I would like to to become hidden when the window is resized smaller than the width of the two images:
<div id="header"><img src="images/logo.gif"><img src="images/header2.gif"></div>
Yet once the window is narrow enough, the second image spills over to the second line!
The style I have for it:
<style type="text/css">
#header
{ overflow: hidden;
background-color:#003366;
width:100%
}
</style>
I don't know if I'm doing something really blockheaded that I didn't notice. Yet I can't find anything wrong with what I've done... If this looks fine, I'll be glad to post more code, but I imagine the problem must be in this area...
Thanks!
What if I don't want the images to jump to different lines, but induce a window scrollbar instead? (Ie, all the images stay on the same line)
It seems as if overflow:auto and scroll can only make the scrollbars for the particular div it's referring to.
Thanks!
I added links to the images as such:
<div id="header"><a href="http://www.link.ca"><img src="../images/logo.gif" border="0"></a><a href="http://www.link.ca"><img src="../images/header2.gif" border="0"></a></div
And my CSS now looks like:
#header
{
overflow: hide;
background-color:#003366;
height:87px;
width:100%;
padding:0;
margin:0;
}
When I set overflow to auto, a vertical scrollbar appears within the header div with just a bit of scrolling. The images are exactly 87 pixels high. I don't see why the scrollbar should be appearing at all...
When I set it to overflow, the div's scrollbar disappears, but then when the window is horizontally shrunk enough, the images break to different lines!
Any suggestions? Thanks so much for your time