lional Posted October 4, 2007 Share Posted October 4, 2007 I am writing a php script with several <a> tags. I need to format one set on the left hand side of the page but not the rest. I have used the following css code, but it formats all of the <a> tags. Is there a way around this? Here is my css code: a:link { background-color: #fac601; color: #922828; font-weight: bold; width="200"; } a:visited { background-color: #fac601; color: #922828; font-weight: bold; width="200"; } a:hover { background-color: #922828; color: #fac601; font-weight: bold; width="200"; } a:active { background-color: #922828; color: #fac601; font-weight: bold; width="200"; } Thanks Lional Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted October 4, 2007 Share Posted October 4, 2007 assuming that all the tags on the 'left hand side are in a separate div to others... give that div an id (eg id="leftpanel") then in css div#leftpanel a, div#leftpanel a:link, div#leftpanel a:visited { .... } div#leftpanel a, div#leftpanel a:hover, div#leftpanel a:active { .... } this will only aply the style to those elements make sure you don't redeclare a selector after this that will impace on the style (i.e. don't declare another set of a styles without another selector before them). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.