Make Div on right side fill out all available space

后端 未结 5 1397
清酒与你
清酒与你 2021-01-28 04:27

I want to create two divs beside each other, however I want the one on the left side to be 300px, and the right one to take up the remaining amount on the screen. How would that

5条回答
  •  日久生厌
    2021-01-28 05:03

    One solution is to float: left; the left div that's 300px wide, and then apply overflow: hidden; to your right div. Here's the basic outline:

    HTML:

    Glee is awesome!
    Glee is awesome!

    CSS:

    .left {
        width: 300px;
        float: left;
    }
    .right {
        overflow: hidden;
    }
    

    And a little demo: little link.

提交回复
热议问题