Home > Article > Web Front-end > How to Fix the Sidebar Navigation in Fluid Twitter Bootstrap 2.0?
Achieving a sidebar navigation that remains stationary while scrolling in a fluid layout is straightforward.
CSS
Define a new sidebar-nav-fixed class to fix your sidebar and add an offset class to your content div to compensate for the left margin:
For responsive compatibility, consider the following CSS:
Note that there is a minor width discrepancy in the fixed sidebar due to it not inheriting the width from the container div.
To keep the sidebar fixed until the grid drops for mobile view, use this CSS:
The above is the detailed content of How to Fix the Sidebar Navigation in Fluid Twitter Bootstrap 2.0?. For more information, please follow other related articles on the PHP Chinese website!