Two divs, one fixed width, the other, the rest

前端 未结 10 1209
死守一世寂寞
死守一世寂寞 2020-11-27 11:28

I\'ve got two div containers.

Whilst one needs to be a specific width, I need to adjust it, so that, the other div takes up the rest of the space. Is there any way I

10条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-27 11:57

    1- Have a wrapper div, set the padding and margin as you like
    2- Make the left side div the width you need and make it float left
    3- Set the right side div margin equal to the left side width

    .left
    {
        ***width:300px;***
        float: left;
        overflow:hidden;
    
    }
    
    .right
    {
        overflow: visible;
        ***margin-left:300px;***
    }
    
    
    
    
    ...
    ...

    Hope this works for you!

提交回复
热议问题