Jump to content

Navigation problem


RizwanAhmedMemon
 Share

Recommended Posts

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

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> :)

Edited by smiles
Link to comment
Share on other sites

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.

Edited by thescientist
Link to comment
Share on other sites

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?? :Pleased: James

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...