Back to the
Component Shop
Read this first! Accordion Auto Sidebar Backbutton Before/After Comparison Collapsible Alert Count-down Script CSS Parallax Cut-out Text Drop-down Equal Height Columns Filtered Portfolio Flip-cards Hamburger Menu Horizontal Tabs Image Gallery Image Modal Image Shapes Image Slider with Fade Jquery Parallax Lazy Loading Lightbox Gallery Masonry Grid Gallery Oval Image Range Slider Read More Button Responsive Navbar Responsive Shrinknav Responsive Sidebar Responsive Table Round Image Scroll to Top Simple Shapes Simple Cards Simple Slider Skill Bars Slide-in Nav Sticky Navbar Tabbed Gallery Text on Image Translucent Image Translucent Text Layer Vertical Tabs Video Wrapping Text

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.