Welcome to WebmasterWorld Guest from 23.22.182.29

Forum Moderators: not2easy

Message Too Old, No Replies

css specific to elements

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

Junior Member

5+ Year Member

joined:June 23, 2009
posts: 42
votes: 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
9:08 pm on Jan 24, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 4, 2001
posts:2143
votes: 7


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
11:29 pm on Jan 24, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:June 23, 2009
posts: 42
votes: 0


That worked great thanks
2:38 am on Jan 25, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 4, 2001
posts:2143
votes: 7


Glad to help.

Marshall
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members