homepage Welcome to WebmasterWorld Guest from 23.20.61.85
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
css specific to elements
roclimb

5+ Year Member



 
Msg#: 4410393 posted 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?

Thanks
Rob

 

Marshall

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4410393 posted 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
}

Marshall

roclimb

5+ Year Member



 
Msg#: 4410393 posted 11:29 pm on Jan 24, 2012 (gmt 0)

That worked great thanks

Marshall

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4410393 posted 2:38 am on Jan 25, 2012 (gmt 0)

Glad to help.

Marshall

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