Div side by side without float

后端 未结 6 1209
自闭症患者
自闭症患者 2020-12-01 01:31

How can I make div \'left\' and \'right\' look like columns side by side?

I know I can use float:left on them and that will work... but on step 5 and 6 in here http

6条回答
  •  星月不相逢
    2020-12-01 01:52

    Use display:table-cell; for removing space between .Left and .Right

    div.left {
        background:blue;
        height:200px;
        width:300px;
    }
    
    div.right{
        background:green;
        height:300px;
        width:100px;
    }
    
    .container{
        background:black;
        height:400px;
        width:450px;
    }
    
    .container > div {
        display: table-cell;
    }
    LEFT
    RIGHT

提交回复
热议问题