X
Back to the
Component Shop
Read this first! Accordion Alert / Callout Another Lightbox Gallery Auto Sidebar Backbutton Basic Form Before/After Comparison Buttons Collapsible Alert Contact Form Count-down Script CSS Parallax Cut-out Text Decorative Background Details/Summary Classes Drilldown Menu Drop-down Equal Height Columns Filtered Portfolio Flip-cards Glossary Table Hamburger Menu HTML Quiz Horizontal Tabs Image Gallery Image Modal Image Shapes Image Slider with Fade Jquery Parallax Lazy Loading Lightbox Gallery Masonry Grid Gallery Mega Menu Modal Optimal Image Sizes Oval Image PHP Includes Range Slider Read More Button Responsive Card Table Responsive Navbar Responsive Shrinknav Responsive Sidebar Responsive Table Round Image Scroll to Top Searchbox Simple Shapes Simple Cards Simple Slider Skill Bars Slide-in Nav Subnav in Dropdowns Tabbed Gallery Tab Navigation Text on Image Translucent Image Translucent Text Layer Vertical Tabs Video Video Scroller Wrapping Text Years Completed Zebra Striped Table

Responsive Sidebar

Responsive Sidebar

The sidebar that you see on desktop and laptop computers is transformed to a top navigation bar when the screen size is reduced to 700px or less. This is done by using media queries.
Another media query for screens that are 500px or less has been added, which will vertically stack and center the navigation links.

The sidebar has a fixed position, and to prevent it from covering the contents (e.g. this text), the class .content needs a left margin the same width as the sidebar. It would be best to extend this class down the page and place all the contents inside it. The width of the navigation is limited on this page by width settings on an outer container. This can be changed - or removed.

Resize the browser window to see the effect.

Download the component.