CSS Problem to make 2 divs float side by side

前端 未结 4 1751
野的像风
野的像风 2020-12-19 18:41

I would like 2 divs, which are within a container div, to appear side-by-side. However the second one wraps for some reason. The 2nd div promo is below and to the right th

4条回答
  •  -上瘾入骨i
    2020-12-19 19:29

    Use the float css property

    #top-feature {
        background: red;
        height: 320px;
        width: 897px;
    }
    
    #top-feature div {
        float: left;
    }
    
    #slideshow {
        height: 300px;
        width: 548px;
        background: blue;
    }
    
    #promo {
        background: green;
        height: 100px;
        width: 200px;
    }
    

    See: http://www.jsfiddle.net/K64vZ/

提交回复
热议问题