Forum Moderators: not2easy
Inside this <div> are several <p>s that are float:left block elements. Each of these <p>s contains a picture and a line of text which open a new window when clicked.
The problem is that the overflow in the <div> is not working.
Here is the code:
#subcontent {
color: #663c13;
background-color: white;
display: block;
margin-top: 20px;
margin-left: 20px;
padding: 5px 15px;
width: 581px;
height: 308px;
float: left;
overflow: auto;
border: solid 1px
}
.coll_thumb {
color: #663c13;
font-family: Futura, Helvetica, Geneva, Arial, SunSans-Regular, sans-serif;
text-align: center;
display: block;
margin: 8px;
padding: 0;
float: left;
overflow: auto
}
<div id="subcontent">
<p class="coll_thumb"><a href="javascript:location='collections_metro.html'; window.open('#','print','height=600,width=600,scrollbars=no')"><img src="images/thumb_test.jpg"><br />test</a></p>
<p class="coll_thumb"><a href="javascript:location='collections_metro.html'; window.open('#','print','height=600,width=600,scrollbars=no')"><img src="images/thumb_test.jpg"><br />test</a></p>
<p class="coll_thumb"><a href="javascript:location='collections_metro.html'; window.open('#','print','height=600,width=600,scrollbars=no')"><img src="images/thumb_test.jpg"><br />test</a></p>
<p class="coll_thumb"><a href="javascript:location='collections_metro.html'; window.open('#','print','height=600,width=600,scrollbars=no')"><img src="images/thumb_test.jpg"><br />test</a></p>
<p class="coll_thumb"><a href="javascript:location='collections_metro.html'; window.open('#','print','height=600,width=600,scrollbars=no')"><img src="images/thumb_test.jpg"><br />test</a></p>
<p class="coll_thumb"><a href="javascript:location='collections_metro.html'; window.open('#','print','height=600,width=600,scrollbars=no')"><img src="images/thumb_test.jpg"><br />test</a></p>
<p class="coll_thumb"><a href="javascript:location='collections_metro.html'; window.open('#','print','height=600,width=600,scrollbars=no')"><img src="images/thumb_test.jpg"><br />test</a></p>
</div>
Can anyone explain why the overflow just switches to visible?
Thanks,
Mike
[edited by: tedster at 6:25 pm (utc) on Oct. 14, 2005]
[edit reason] fix formatting [/edit]
To force the parent div to acknowledge its children, try having a <br style="clear:both;" /> below the floats.
So if this method won't work, can anyone suggest a simpler way for me to do what I'm trying to do? I have also tried adding the max-height property to the <div> but with no success.
Basically there's the <div> which is the box. Within this box I want to have a large number of images, each with a line of text below it and each of these images needs to have the <a> tag with the javascript to open a new window.
The box needs to stay the same size all the time because there is other content below it.
PLEASE! any suggestions at all would be helpful. I am sure I'm just overlooking something obvious. This is what happens when I try to teach myself.
Thanks,
Mike
[edited by: tedster at 6:30 pm (utc) on Oct. 14, 2005]
[edit reason] formatting [/edit]
So the strange thing is that the overflow seems to work fine on Firefox, Opera, and even IE5 (mac). But not Safari.
This problem is really frustrating me. Is it a bug in Safari?
I've posted two screenshots on my website:
<Sorry, no personal URLs.
See Forum Charter [webmasterworld.com]>
please let me know if you can tell what I'm doing wrong.
Thanks
[edited by: tedster at 6:22 pm (utc) on Oct. 14, 2005]