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

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -