Skip to content

Buzzingz

Unleashing the Power of Code

  • HTML
  • CSS
  • Toggle search form

CSS Vertical Navigation Bar

Posted on March 15, 2023March 15, 2023 By shani No Comments on CSS Vertical Navigation Bar

To create a vertical navigation bar using CSS, we can use the following steps:

  1. Create an HTML unordered list (<ul>) to hold the navigation links.
  2. Apply a class or ID to the <ul> element to target it in CSS.
  3. Set the display property of the <ul> element to inline-block to make it a block-level element that can have a width and height.
  4. Set the list-style-type property to none to remove the bullet points.
  5. Set the padding property to create some space between the list items and the edges of the <ul> element.
  6. Apply a background color and font styles to the list items (<li> elements).
  7. Set the width property of the <li> elements to make them display vertically.
  8. Add styles to the a tags inside the list items to control their appearance.

Here’s an example CSS code for a basic vertical navigation bar:

ul {
  display: inline-block;
  list-style-type: none;
  padding: 0;
  margin: 0;
  background-color: #f1f1f1;
  width: 200px;
}

li a {
  display: block;
  color: #000;
  padding: 8px 16px;
  text-decoration: none;
}

li a:hover {
  background-color: #555;
  color: #fff;
}

And here’s an example HTML code for a basic vertical navigation bar:

<ul>
  <li><a href="#">Home</a></li>
  <li><a href="#">About</a></li>
  <li><a href="#">Services</a></li>
  <li><a href="#">Contact</a></li>
</ul>

This will create a vertical navigation bar with a light gray background color, black text, and white text on hover. You can customize the CSS code to change the colors, font styles, and other properties to match your desired design.

CSS

Post navigation

Previous Post: CSS Navigation Bar
Next Post: CSS Horizontal Navigation Bar

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

CSS Tutorial

  • Basic CSS Tutorial For Beginners
  • CSS Introduction
  • CSS Syntax
  • CSS Selectors
  • How To Add CSS
  • CSS Comments
  • CSS Colors
  • CSS Backgrounds
  • CSS Borders
  • CSS Margins
  • CSS Margin Collapse
  • CSS Padding
  • CSS Height, Width and Max-width
  • CSS Box Model
  • CSS Outline
  • CSS Text
  • CSS Fonts
  • CSS Web Safe Fonts
  • CSS Font Fallbacks
  • CSS Font Style
  • CSS Font Size
  • CSS Google Fonts
  • CSS Great Font Pairings
  • CSS Icons
  • CSS Links
  • CSS Lists
  • CSS Tables
  • CSS Layout – display: inline-block
  • CSS Layout – float and clear
  • CSS Layout – Horizontal & Vertical Align
  • CSS Layout – Overflow
  • CSS Layout – The display Property
  • CSS Layout – The z-index Property
  • CSS Layout – width and max-width
  • CSS Layout – The position Property
  • CSS Attribute Selectors
  • CSS Image Sprites
  • CSS Image Gallery
  • CSS Dropdowns
  • CSS Horizontal Navigation Bar
  • CSS Vertical Navigation Bar
  • CSS Navigation Bar
  • CSS Opacity / Transparency
  • CSS Pseudo-elements
  • CSS Pseudo-classes
  • CSS Combinators
  • CSS Math Functions
  • CSS The !important Rule
  • CSS Specificity
  • CSS Units
  • CSS Website Layout
  • CSS Counters
  • CSS Forms
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions

Copyright © 2023 Buzzingz.

Powered by PressBook WordPress theme