RizwanAhmedMemon Posted April 16, 2012 Share Posted April 16, 2012 I have a problem in navigation bar I have made a horizontal navigation bar same navigation I have kept in vertical also but I want to have my vertical one a different formating. But I can't give it different formatting because in my external style sheet I have given formatting which applies on my "a href" element. Since the vertical navigation is also made using "a href" so it is also getting the same formating as I have given to my horizontal navigation bar. How can I get out of this problem and can make my vertical navigation bar different by giving it different formatting? Link to comment Share on other sites More sharing options...
smiles Posted April 16, 2012 Share Posted April 16, 2012 Hi! Nesting selectors may help u, like this example <html><head><style type="text/css">p a {color:red;}span a {color:green;}</style></head><body><p>This is a <a href="....">link</a> within a paragraph element.</p><span>This is a <a href="....">link</a> within a span element.</span></body></html> Link to comment Share on other sites More sharing options...
thescientist Posted April 16, 2012 Share Posted April 16, 2012 please explain questions by providing code and or links to the code, but this is probably just a simple case of how well you uze your CSS selectors. Link to comment Share on other sites More sharing options...
alvo Posted April 17, 2012 Share Posted April 17, 2012 I may be wrong here, but I would suggest nesting all of your links inside a list (<ul></ul>). I would use ID selectors to define differences between the horizontal and vertical navigation, and all of the generic properties for each link can be defined using classes? ( eg .navigationLinks a {color:#ffffff;} ) I would avoid using selectors for href's and where possible use the full address to elements, eg. #navigationHorizontalBar ul li a {} Thoughts anyone?? James Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.