Welcome to WebmasterWorld Guest from 54.147.20.131

Forum Moderators: not2easy

Message Too Old, No Replies

css specific to elements

     

roclimb

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

5+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



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

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

5+ Year Member



That worked great thanks

Marshall

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

WebmasterWorld Senior Member 10+ Year Member



Glad to help.

Marshall
 

Featured Threads

Hot Threads This Week

Hot Threads This Month