April 12, 2025
 
Advertisement

Latest News

  1. jQuery Content Scroller
  2. Banner Rotator jQuery
  3. Unleash Accordion Slider
  4. Parallax Slider
  5. Galleria
  6. Showbiz Pro Teaser
  1. Banner Rotator jQuery
  2. Unleash Accordion Slider
  3. Parallax Slider
  4. Galleria
  5. Showbiz Pro Teaser
  6. KenBurner Slider jQuery

ELECTRIC GUITAR

    "How Blogs we immediately famous and swamped" 1. Start by setting Permalinks This is the earliest s...

Published by Admin

TOP LINE

Free Keyword Research Tools 1. Google Adwords Keyword Research Tool Google adwords external keyword tool is the best t...

Published by Admin

LATEST

Blog is short for web log is a web application that resembles the form of writings (published as a post) on a public web pag...

Published by Admin

TUTORIALS

HIGHLIGHT

Demo Download DZS Content Scroller is a solid, ad [...]

Published by Admin
06 Aug 2013 0 comments

Demo Download  UPDATE COMPLETE, VERSION V 3.0 IS AVAIL [...]

Published by Admin
06 Aug 2013 1 comments

Demo Download ChangeLog: Version [1.1] The Slider is Now responsive [...]

Published by Admin
06 Aug 2013 0 comments

PERFORMANCE

Cara Membuat Recent Comment di Blog : Masuk blogger > Design/Rancangan [...]

Published by Admin
18 Sep 2012 1 comments

Ada pilihan untuk memasukan username, warna background, dan jumlah follower. [...]

Published by Admin
18 Sep 2012 0 comments

Tutorialnya mudah, ikuti langkah-langkah dibawah ini : Cara Pertama : [...]

Published by Admin
14 Sep 2012 0 comments

Navigation Bar with CSS Vertical

By Unknown - Sunday, February 10, 2013





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>

Try it yourself »
Now let's remove the bullets and the margins and padding from the list:

Example

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

Try it yourself »
Example explained:
  • list-style-type:none - Removes the bullets. A navigation bar does not need list markers
  • Setting margins and padding to 0 to remove browser default settings
The code in the example above is the standard code used in both vertical, and horizontal navigation bars.

Vertical Navigation Bar

To build a vertical navigation bar we only need to style the <a> elements, in addition to the code above:

Example

a
{
display:block;
width:60px;
}

Try it yourself »
Example explained:
  • display:block - Displaying the links as block elements makes the whole link area clickable (not just the text), and it allows us to specify the width
  • width:60px - Block elements take up the full width available by default. We want to specify a 60 px width

Follow our blog on Twitter, become a fan on Facebook. Stay updated via RSS

0 komentar for "Navigation Bar with CSS Vertical"

Leave a Reply

Pages 22123456 »
Advertisement