css - Floating divs not aligning the way I want them -


a simple css question. have page want blocks float nicely:

<div style="float: left; width: 620px;">     <div style="float: left; width: 300px; background-color: red; height: 230px;"></div>     <div style="float: left; width: 300px; background-color: blue; height: 330px;"></div>     <div style="float: left; width: 300px; background-color: green; height: 230px;"></div></div> 

i green div display under red div , not aligned end of blue div.

changing order not solution me coming in specific order db.

regards jonas

if understood requirement correctly, below need.

i changed blue div float: right green div comes under red div.

<div style="float: left; width: 620px;">     <div style="float: left; width: 300px; background-color: red; height: 230px;"></div>     <div style="float: right; width: 300px; background-color: blue; height: 330px;"></div>     <div style="float: left; width: 300px; background-color: green; height: 230px;"></div> </div> 

working demo


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -