Skip to content
Iampsp Blog

Iampsp Blog

I am a programming service provider

My Portfolio
Project order
Reviews
Favorite Exchange

Categories

  • C
  • C#
  • C++
  • CSS
  • Firefox Addons
  • Firefox Themes
  • HTML
  • JAVA
  • JavaScript
  • jQuery
  • Mybb Plugins
  • MySQL
  • PHP
  • Python
  • React
  • SQL

Recent Posts

  • jQuery – The noConflict() Method
  • jQuery – AJAX get() and post() Methods
  • jQuery – AJAX load() Method
  • jQuery – AJAX Introduction
  • jQuery Traversing – Filtering

CSS Navigation Bar

Navigation Bars

Having easy-to-use navigation is important for any web site.

With CSS you can transform boring HTML menus into good-looking navigation bars.

Navigation Bar = List of Links

A navigation bar needs standard HTML as a base.

In our examples we will build the navigation bar from a standard HTML list.

A navigation bar is basically a list of links, so using the <ul> and <li> elements makes perfect sense:

Example

<ul>
  <li><a href="default.asp">Home</a></li>
  <li><a href="news.asp">News</a></li>
  <li><a href="contact.asp">Contact</a></li>
  <li><a href="about.asp">About</a></li>
</ul>

Now let’s remove the bullets and the margins and padding from the list:

Example

ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

Example explained:

  • list-style-type: none; – Removes the bullets. A navigation bar does not need list markers
  • Set margin: 0; and padding: 0; to remove browser default settings

 

Posted on 2025-02-10Author MostafaCategories CSSTags css, css flex, css frankfurt, css grid, css navigation bar, css navigation bar center, css navigation bar horizontal, css navigation bar horizontal full width, css navigation bar responsive, css navigation bar styles, css navigation bar template, css navigation bar tutorial, css navigation bar with dropdown, css navigation bar with logo, css selectors, css variables, cssbuy, cssf, cssps, csstats

Post navigation

Previous Previous post: CSS Opacity and Transparency
Next Next post: CSS Dropdowns
Proudly powered by WordPress