1

I am working with bootstrap 3 and I like to create my fixed header. The problem is when the fixed header get fixed the header increase to a width 100%.

I have put my problem into an example:

http://www.bootply.com/MTi0Nr1N9s

Here is a screen what happens:

http://awesomescreenshot.com/0a75pjah7a

Does anybody has an idea whats wrong?

dermold
  • 91
  • 2
  • 13

1 Answers1

1

This is due to the normal behaviour of position:fixed:

The position and dimensions of an element with position:fixed are always relative to the initial containing block. This is normally the viewport: the browser window or the paper’s page box.

Source: answer

To overcome this problem, you have to fix the width of container (example: width: 1170px) and changing the width of the header to inherit instead of 100%.

Community
  • 1
  • 1
silviagreen
  • 1,679
  • 1
  • 18
  • 39