Friday 6 July 2012

HORIZONTAL NAVIGATION BAR


Horizontal Navigation Bar

There are two ways to create a horizontal navigation bar. Using inline or floating list items.
Both methods work fine, but if you want the links to be the same size, you have to use the floating method.

Inline List Items

One way to build a horizontal navigation bar is to specify the <li> elements as inline, in addition to the "standard" code above:

Example

li
{
display:inline;
}
Example explained:
  • display:inline; - By default, <li> elements are block elements. Here, we remove the line breaks before and after each list item, to display them on one line.

No comments:

Post a Comment