Twitter Bootstrap modal opening/closing causes fixed header to jump

后端 未结 14 2453
旧时难觅i
旧时难觅i 2021-01-08 01:39

I am almost done with a simple 2-page website for my registered domain names. Unfortunately I have one small issue I can\'t seem to fix: a jumpy header when a Twitter Bootst

14条回答
  •  误落风尘
    2021-01-08 01:49

    As you usually put Bootstrap navbar as a direct child of the body container:

    
      
    
    

    You can use the body padding-right value, calculated in the Bootstrap core code to prevent it from "jumping" when opening a modal window, to fix the navbar issue as well . A pure CSS solution is below:

    .navbar-fixed-top {
      padding-right: inherit;
    }
    

    Easy as that.

提交回复
热议问题