Skip to content
Learn Netverks

Lesson

Step 15/36 42% through track

navbar

Navbars

Last reviewed Jun 1, 2026 Content v20260601
Track mode
iframe_html
Means
HTML preview sandbox
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches Navbars—the ideas, syntax, and habits you need before moving on in Bootstrap.

Bootstrap patterns appear constantly in legacy apps and rapid admin UI work.

You will apply Navbars in contexts like: Internal tools, WordPress themes, Laravel apps, and teams that want opinionated UI without writing every rule from scratch.

Read the lesson, edit HTML/CSS in the playground, press Run to preview, then answer the lesson MCQs.

When the previous lesson's MCQs feel easy and you can explain Navbars in your own words.

Navbars combine branding, navigation links, and toggles. Core classes: navbar, navbar-expand-lg (collapse below lg), navbar-brand, and navbar-nav on a <ul>.

Collapse pattern

Below the expand breakpoint, links hide inside .collapse.navbar-collapse. The toggler button uses data-bs-toggle="collapse" and data-bs-target—Bootstrap JS handles the interaction. Always include aria-controls and aria-expanded for accessibility.

Important interview questions and answers

  1. Q: What does navbar-expand-md mean?
    A: Navbar is expanded (horizontal) from md up; below md, content collapses behind the toggler.
  2. Q: Why is JS required?
    A: Collapse toggling, dropdown menus in nav, and scrollspy are behavior plugins—not pure CSS.
  3. Q: Navbar vs nav?
    A: .nav styles a list of links; .navbar adds layout, brand slot, toggler, and responsive collapse shell.

Self-check

  1. Which attribute connects the toggler to the collapsible region?
  2. What class keeps nav links horizontal on large screens?

Challenge

Collapsible nav

  1. Use navbar + toggler markup from the lesson.
  2. Resize below lg and open the menu.

Done when: collapse toggler reveals nav links on small screens.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • What breaks if toggler markup is wrong?
  • How would you mark current page for a11y?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump