CSS Div width percentage and padding without breaking layout

前端 未结 3 500
忘掉有多难
忘掉有多难 2020-12-07 15:54

There may be a simple fix for this, but it has troubled me for ages now...

Let me explain the situation. I have a div with the ID \'container\' that holds all the

3条回答
  •  时光说笑
    2020-12-07 16:26

    Try removing the position from header and add overflow to container:

    #container {
        position:relative;
        width:80%;
        height:auto;
        overflow:auto;
    }
    #header {
        width:80%;
        height:50px;
        padding:10px;
    }
    

提交回复
热议问题