I've defined my div's height in a stylesheet:
.topbar{ width:100%; height:70px; background-color:#475; }
But as soon as text is entered into the div, the divs height changes.
Any ideas?
Absolute positioning removes the content div (and everything else) from the flow of the page. That makes it so the containers don't know the size of the inner elements. Remove all the . abs classes from everything inside the container, and the white background will correctly stretch as you want.
The two or more different div of same height can be put side-by-side using CSS. Use CSS property to set the height and width of div and use display property to place div in side-by-side format. The used display property are listed below: display:table; This property is used for elements (div) which behaves like table.
This seems like the ideal candidate for transition from a table-based layout to a CSS layout. It makes sense: both DIVs and tables can be nested, have HEIGHT and WIDTH attributes set, contain borders, etc.
change the div to display block
.topbar{ display:block; width:100%; height:70px; background-color:#475; overflow:scroll; }
i made a jsfiddle example here please check
http://jsfiddle.net/TgPRM/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With