If you use list items as markup for your navigation, you can display the line between each link by creating a separator as a background image on li .
The trick to making it appear only between list items is to place the image to the left of li , but not on the first. This example uses the adjacent selector:
#nav li + li { background:url('seperator.gif') no-repeat top left; padding-left: 10px }
This CSS adds an image to each element of the list that follows another element of the list — in other words, all of them except the first.
Alternatively, you can use the CSS content property with the before pseudo-class instead of the image. The following code adds a channel in front of your navigation links (again using the adjacent selector).
#nav li + li a:before { content: "|"; }
Be aware that the content property is not supported in IE6 and IE7, and the adjacent selector is not supported in IE6.
See here for CSS content and browser compatibility - http://www.quirksmode.org/css/contents.html
ajcw
source share