CSS Vertical Navigation with Teaser
Blog » CSS/XHTML » CSS Vertical Navigation with TeaserCSS Vertical Navigation with Teaser
This technique is a simple way to display some teaser information for your vertical navigation. I won’t waste any of your time with an intro, let’s get right into the code.
HTML
We will start by creating a list item, but in this case, we will add an empty ‘span’ tag inside of the hyper link. The CSS will look at the content of the span tag as a display: none until it’s hovered over.
<ul class="sidenav"> <li> <a href="#">Home <span>Blandit turpis patria euismod at iaceo appellatio, demoveo esse. Tation utrum utrum abigo demoveo immitto aliquam sino aliquip. </span> </a> </li> <li> <a href="#">Blog <span>Blandit turpis patria euismod at iaceo appellatio, demoveo esse. Tation utrum utrum abigo demoveo immitto aliquam sino aliquip. </span> </a> </li> <li> <a href="#">Tutorials <span>Blandit turpis patria euismod at iaceo appellatio, demoveo esse. Tation utrum utrum abigo demoveo immitto aliquam sino aliquip. </span> </a> </li> </ul>
CSS
We will first style the vertical navigation list. What I like to do is add a light bevel look on each of the navigation links.
ul.sidenav {
font-size: 1.2em;
float: left;
width: 200px;
margin: 0;
padding: 0;
list-style: none;
background: #005094;
border-bottom: 1px solid #3373a9;
border-top: 1px solid #003867;
}
ul.sidenav li a{
display: block;
color: #fff;
text-decoration: none;
width: 155px;
padding: 10px 10px 10px 35px;
background: url(sidenav_a.gif) no-repeat 5px 7px;
border-top: 1px solid #3373a9;
border-bottom: 1px solid #003867;
}
Then we will now add the hide/show effect when it’s hovered.
ul.sidenav li a:hover {
background: #003867 url(sidenav_a.gif) no-repeat 5px 7px;
border-top: 1px solid #1a4c76;
}
ul.sidenav li span{ display: none; }
ul.sidenav li a:hover span {
display: block;
font-size: 0.8em;
padding: 10px 0;
}
Bevel Colors
How did I choose the right colors to achieve the bevel look?
- Open Photoshop
- Create a new document of any size, I just did a random size of 300×300
- Fill the background with your <ul> base background color.
- Using your marquee tool, set it to the ‘single row marquee tool’
- Create a new layer and fill it with white
- Duplicate this layer but this time fill it with black.
- Now lower the opacity on those layers: Black Layer: 30% / White Layer 20%
- Now using the Eyedropper tool, select the two colors.


Conclusion
In addition to adding teaser information to the navigation, this technique can be modified to add descriptions to any element of page. You could add teaser descriptions to profile names, question-and-answer type FAQ pages, navigation, or a multitude of other applications.
Similar Posts:
This entry was posted on Monday, December 15th, 2008 at 2:40 pm and is filed under CSS/XHTML. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.






Another fine example of a good menu! Thanks for the share!
Soh, you have such a clean style! Thanks for this menu I’m thinking of modifying it to allow for a rating system as well as for a social media bookmark menu!
Thanks! I’m glad it was useful
Entirely CSS based? Nicely done!
Is it possible to put links instead of the teaser text?
In order to add links I would suggest using a different technique and it involves a little bit of javascript.
Due to IE6 not supporting hover effects on anything other than a link, you would have to use javascript and it cannot be pure css~
very good, thanks
I’m sorry, I’m new to this, but you said you added an emptey ’span’ tag into the hyperlink, but there’s text in the span tag i.e Blandit turpis patria euismod at iaceo appellatio, demoveo esse. Tation utrum utrum abigo demoveo immitto aliquam sino aliquip. I’m confused.
Sorry, I think I did a poor job explaining that portion, you wrap a span around your teaser copy (Not an empty span)
Let me know if you have any questions~
nice ……………..
Good! Thank you for the tutorial
does this work in all browsers?
are there any known issues in the main browsers such as IE 6, 7, 8, FF 3, Safari, Opera etc.
Thank you and great effect
Also – presumably it would be easy to place an image inside the span if one so wished? or am i mistaken?
thank you
Большое спасибо. Прочитал с интересом, и вообще полезный у Вас блог
Thank you so much….
Thank you for such a nice article it helped me creating similar navigation. Keep up the good work.