homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

css specific to elements

 7:25 pm on Jan 24, 2012 (gmt 0)

Was wondering if anyone knows of a way to use css style sheet to target a specific set of elements like a navigation bar only.

I have a style sheet for my entire page but want a separate sheet to target only my navigation bar. the navigation bar is composed f several divs and Ul Li classes. I want them targeted by one css style sheet. How can I do this?




 9:08 pm on Jan 24, 2012 (gmt 0)

If you navigation <div> has a specific id, you can target specific items within it:

#Nav li a {
color: #F00;
text-decoration: none;

For example. Begin whatever you want to target with the id of its parent. You can drill down as far as you need.

#Nav ul li ul li a {
blah blah



 11:29 pm on Jan 24, 2012 (gmt 0)

That worked great thanks


 2:38 am on Jan 25, 2012 (gmt 0)

Glad to help.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved