Floss Posted March 9, 2010 Share Posted March 9, 2010 I'm trying to create a nav bar for my site. I am using an external style sheet. I am having trouble getting my CSS to only style the nav bar and not all the list and links on the page.I am using a <div id="navbar"> in my html.How do I get the my CSS to only style the <ul>s, <li>s, and <a>s within that division? Link to comment Share on other sites More sharing options...
Synook Posted March 9, 2010 Share Posted March 9, 2010 div#navbar ul { }div#navbar li { }/* etc */ Link to comment Share on other sites More sharing options...
Floss Posted March 9, 2010 Author Share Posted March 9, 2010 Thanks that worksI thought there was a way to lump all the elements within a division together without expressing id for each element individually. Guess I was just being a noob Link to comment Share on other sites More sharing options...
thescientist Posted March 9, 2010 Share Posted March 9, 2010 maybe something like this? div#navbar ul li a{} but then that would assume you would the same styles applied to all three elements. Link to comment Share on other sites More sharing options...
Floss Posted March 9, 2010 Author Share Posted March 9, 2010 yes except i have to do the a selector twice (one for normal and one for hover) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.