[html] arranging div one below the other

I have two inner divs which are nested inside a wrapper div. I want the two inner div's to get arranged one below the other. But as of now they are getting arranged on the same line.

_x000D_
_x000D_
#wrapper{_x000D_
        margin-left:auto;_x000D_
        margin-right:auto;_x000D_
        height:auto; _x000D_
        width:auto;_x000D_
    }_x000D_
    #inner1{_x000D_
        float:left; _x000D_
    }_x000D_
    #inner2{_x000D_
        float:left; _x000D_
    } _x000D_
 
_x000D_
  <div id="wrapper">_x000D_
        <div id="inner1">This is inner div 1</div>_x000D_
        <div id="inner2">This is inner div 2</div>_x000D_
    </div>
_x000D_
_x000D_
_x000D_

This question is related to html css

The answer is


Try a clear: left on #inner2. Because they are both being set to float it should cause a line return.

_x000D_
_x000D_
#inner1 {_x000D_
   float:left; _x000D_
}_x000D_
_x000D_
#inner2{_x000D_
   float:left; _x000D_
   clear: left;_x000D_
}
_x000D_
<div id="wrapper">_x000D_
    <div id="inner1">This is inner div 1</div>_x000D_
    <div id="inner2">This is inner div 2</div>_x000D_
</div>
_x000D_
_x000D_
_x000D_


Similar questions with html tag:

Similar questions with css tag: