html - How do I get floating divs to break directly to the left of the viewport? -
html - How do I get floating divs to break directly to the left of the viewport? -
please see illustration below, , shrink viewport width.
as viewport width shrinks, want 4th div go straight under first div, , shrinks more, want 3rd div under 1st, , 4th under 2nd. understand why happening, don't know behaviour want.
please help!
<html> <head> <style> .columnclass { float:left; border: 2px solid; } </style> </head> <body> <div class="columnclass"> <img src="http://thecybershadow.net/misc/stackoverflow.png" width="400" height="400"/> </div> <div class="columnclass"> <img src="http://thecybershadow.net/misc/stackoverflow.png" width="200" height="600"/> </div> <div class="columnclass"> <img src="http://thecybershadow.net/misc/stackoverflow.png" width="400" height="400"/> </div> <div class="columnclass"> <img src="http://thecybershadow.net/misc/stackoverflow.png" width="200" height="600"/> </div> </body> </html>
change class parameters those:
.columnclass { display: inline-block; vertical-align: top; border: 2px solid; }
http://jsfiddle.net/n7usg/ here i've reduced width of images see working.
html css css-float
Comments
Post a Comment