html - How do you maintain CSS layout when adding content (ASP.NET) -
i have page in asp.net follows.
jsfiddle http://jsfiddle.net/nyrup/
html
<div class="maincontainer"> <div> <div class="topleft"> <% =datetime.now.ticks.tostring()%> </div> <div class="topright"> foo </div> </div> <div> <div class="bottomleft"> foo </div> <div class="bottomright"> foo </div> </div> <div class="underneath"> foo </div> </div>
css
.maincontainer { } .topleft { width: 50%; float: left; background-color: red; } .topright { width: 50%; float: left; background-color: orange; } .bottomleft { width: 50%; float: left; background-color: yellow; } .bottomright { width: 50%; float: left; background-color: green; } .underneath { width: 100%; background-color: blue; }
this works fine, until add content div, @ point layout broken
jsfiddle showing broken layout: http://jsfiddle.net/4gbp8/
how maintain layout when content added please?
i.e.
so able contain them placing container on blank div, called top. think if understand correctly want each box fill page.
http://jsfiddle.net/4gbp8/2/ css add
.top { display: inline-block; width: 100%; height: 100%; }
html
<div class="top"> <div class="topleft"> <p>123</p> <p>123</p> <p>123</p> <p>123</p> </div> <div class="topright"> foo </div> </div>
Comments
Post a Comment