How to make an inline-block element fill the remainder of the line?

前端 未结 7 1615
抹茶落季
抹茶落季 2020-11-28 01:11

Is such a thing possible using CSS and two inline-block (or whatever) DIV tags instead of using a table?

The table version is this (borders added so you can see it):

7条回答
  •  Happy的楠姐
    2020-11-28 01:56

    A modern solution using flexbox:

    .container {
        display: flex;
    }
    .container > div {
        border: 1px solid black;
        height: 10px;
    }
    
    .left {
       width: 100px;
    }
    
    .right {
        width: 100%;
        background-color:#ffffd;
    }

    http://jsfiddle.net/m5Xz2/100/

提交回复
热议问题