Make navigation bar take up entire page height in css

后端 未结 5 1727
梦谈多话
梦谈多话 2021-01-13 01:04

I am designing a website using css and html. I have managed to get a navigation bar on the left side of my page using this css, however when the screen is scrolled down the

5条回答
  •  野的像风
    2021-01-13 01:46

    If you plan to have the navBar fixed you can do something along the lines of Fiddle

    *{
        margin:0;padding:0;
    }
    #navBar {
        background: red;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 100px;
    }
    #content {
        background: yellow;
        min-height:1000px;
        display: block;
        margin-left: 100px; /*width of nav bar*/
    }
    

提交回复
热议问题