471,605 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

How Can I Override CSS in Sidebar for 1 Section?

I am trying to override the default CSS text & link formatting for the right sidebar of my website. I am trying ot paste a 200x200 ad in the sidebar but want to be able to format it independently of how the CSS is formatting the rest of the sidebar.

For example, the links on the sidebar are all italicized & in orange, but I want them to be the standard blue and non-italicized. I tried encasing the html in a table with different formatting, but that did not work.

The Google ads that are on the site are not affected by the CSS but I don't know much about javascript or how to intiate a similar fix.

Any suggestions?
Aug 30 '07 #1
1 1316
markrawlingson
346 Expert 100+
There are three ways to apply CSS :

1) Apply it globally over every single tag element on the page
IE: a { color:orange;}
This will take effect over every single link on the page, except for those which you've defined a different "class" for.

Or

2) set the style statically for each element by its class name or id
IE: a.subMenuLink { color:blue }
This will take effect over all the links on the page which you've defined as class="subMenuLink"
<a href="whatever.html" class="subMenuLink">whatever link</a>

Or

3) Set the style statically inside of each tag itself.
IE: <a href="whatever.html" style="color:blue;">whatever link</a>
This will ONLY affect this particular link.

Option #2 or #3 should solve your problem. They will override your CSS for global link style and apply a different style to just the links you wish it to.
Aug 30 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.