Setting a div's height in HTML with CSS

前端 未结 14 946
无人共我
无人共我 2020-12-05 09:36

I am trying to lay out a table-like page with two columns. I want the rightmost column to dock to the right of the page, and this column should have a distinct background c

14条回答
  •  情歌与酒
    2020-12-05 10:20

    This should work for you: Set the height to 100% in your css for the html and body elements. You can then adjust the height to your needs in the div.

    html {
        height: 100%;
    }
    
    body {
        height: 100%;
    }
    div {
        height: 100%; /* Set Div Height */
    } 
    

提交回复
热议问题