Getting a span element fill the space in a div

前端 未结 3 863
野趣味
野趣味 2021-02-15 17:13

I\'m trying to have something like this:

|--------------fixed width---------------|
 Title1 .......................... value1
 Title2 ................... another valu         


        
3条回答
  •  醉梦人生
    2021-02-15 17:35

    Meanwhile Flexbox has full browser support, which allows for a more elegant solution without the center element.

    .left, .right {
        border: 1px dotted red;      
    }
    
    .container {
        display: flex;
        justify-content: space-between;
        width: 200px;
        border: 1px dotted red;
        padding: 5px;
    }
    Title value

提交回复
热议问题