Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] header nav height not automatically sizing

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #206213
    szahn
    Participant

    My header div that wraps a bootstrap container and row is not automatically sizing its height properly. You’ll see in the JSFiddle that the background gray only covers half of the header where it should be automatically covering all of it based on its content.

    How do I get the header div to automatically adjust it’s height based on the content?

    I’m partially using Bootstrap’s LESS files and incorporating them into my existing styles. The reason is that I don’t need all 4,000 lines of bootstrap code for my app, so I’m being very selective as I already having existing style sheets.

    Am I missing a css style tag or forgot to include some Bootstrap styles somewhere?

    JSFiddle: https://jsfiddle.net/971u1ejg/

    #206214
    Senff
    Participant

    The .row class (that contains the three individual items) needs to be cleared with some form of clearfix.

    Easiest/quickest way is probably to add overflow:hidden; or overflow:auto; to .header .row.

    #206215
    szahn
    Participant

    Thanks,
    That did the trick, who knew!

    Fixed JSFiddle: https://jsfiddle.net/4j1h9dxh/

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.