w1coding.comAll tutorials

W3.CSS Navigation

W3.CSS lessons
  1. Environment Setup
  2. Introduction
  3. Container
  4. Colors
  5. Buttons
  6. Buttons1
  7. Grids
  8. Images
  9. Cards
  10. Tables
  11. Forms
  12. Navigation
  13. Sliders
  14. Modals
  15. Dropdown
  16. Cards
  17. Alerts
  18. Accordions
  19. Ardions
  20. Tooltips
  21. Pagination
  22. Navigation
  23. Slideshow
  24. Tabs
  25. Model
  26. Animations
  27. Responsive

W3.CSS Navigation Bars

W3.CSS provides an easy way to create responsive and styled navigation bars using the w3-bar and w3-bar-item classes.

Basic Navigation Bar

<div class="w3-bar w3-light-grey">
  <a href="#" class="w3-bar-item w3-button">Home</a>
  <a href="#" class="w3-bar-item w3-button">About</a>
  <a href="#" class="w3-bar-item w3-button">Contact</a>
</div>
    

Active and Hover Effects

You can add active and hover styles by using the w3-hover and w3-bar-item classes:

<div class="w3-bar w3-dark-grey">
  <a href="#" class="w3-bar-item w3-button w3-blue">Home</a>
  <a href="#" class="w3-bar-item w3-button w3-hover-blue">About</a>
  <a href="#" class="w3-bar-item w3-button w3-hover-blue">Contact</a>
</div>
    

Responsive Navigation Bar

To make your navigation bar responsive, use the w3-hide-small, w3-hide-medium, or w3-hide-large classes:

<div class="w3-bar w3-light-grey">
  <a href="#" class="w3-bar-item w3-button w3-hide-small">Home</a>
  <a href="#" class="w3-bar-item w3-button w3-hide-small">About</a>
  <a href="#" class="w3-bar-item w3-button">Contact</a>
</div>