tags:

views:

319

answers:

2

I have one div element at the top of my page that is set to overflow:visible. Immediately beneath it, I have the page content.

I do not want the top div to expand, because of aesthetic reasons, but I would like the content below to treat the overflow from above as it would a block element...by "clearing" it.

I know about CSS clear...but it doesn't seem to apply to overflow.

Is there a correct method to do this?

+1  A: 

The overflow:visible doesn't really have anything to do with the issue, as it's the default.

Set the height of the top div, and put another floating div inside it for the content. The floating div will expand outside the top div, and you can use the clear style to get below it.

Guffa
so you mean actually put the content in the top div via a floating div to overflow from the bottom of the top div? sounds cool and interesting...is that structurally sound?
johnnietheblack
Yes, a floating element doesn't affect the size of a parent element, so it can float outside it at the bottom. It's common that you use a clearing div when you don't want this to happen. You need a proper doctype on the page so that IE renders the page in standards compliant mode, or it will expand the parent element to contain the floating children.
Guffa
A: 

try

overflow: auto;

it will expand the div and should solve your problem

Virat Kadaru