Bootstrap: Fill whole container under navbar minus navbar height

后端 未结 1 1625
灰色年华
灰色年华 2021-02-19 20:13

On a page styled with Twitter Bootstrap and using the navbar I wanted to fill the whole container below the navigation bar with a Google Maps map. To accomplish that I

相关标签:
1条回答
  • 2021-02-19 20:41

    You could solve the problem with absolute positioning.

    .fill {
        top: 40px;
        left: 0;
        right: 0;
        bottom: 0;
        position: absolute;
        width: auto;
        height: auto;
    }
    

    Demo (jsfiddle)

    You could also make the navbar .navbar-fixed-top and somehow add a padding or margin inside the #map element.

    0 讨论(0)
提交回复
热议问题