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

前端 未结 10 1185
死守一世寂寞
死守一世寂寞 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

    You can use calc() Function of CSS.

    Demo: http://jsfiddle.net/A8zLY/543/

    .left { height:200px; width:calc(100% - 200px); background:blue; float:left; } .right { width:200px; height:200px; background:red; float:right; }

    Hope this will help you!!

提交回复
热议问题