tags:

views:

42

answers:

4

i am using a definitive style for my tags. now there is one tag that i do not wish to appear that way. how do i do it?

A: 

Give that one tag an ID, and then make a style for that specific ID. It will override the style you set for the "a" tags.

Richard Walters
i have already tried that. does not help.
amit
@amit please show some code.
Pekka
A: 

First, figure out the class or id of the element you want to change the style of using tools like firebug. Once you have found its class or id, search for it in the style sheet and modify the style as you like. If it still does not work, try appending the !important to your style, for example:

.myelement
{
  color: #ff0000 !important;
  font-size: 14px !important;
}

The !important will override any pre-defined styles.

Sarfraz
If you are very specific in your rule (e.g. `a .myelement`) you won't even need `!important`. Avoid `!important` where you can, it makes maintenance of complex CSS style sheets a nightmare. Override styles by specificity instead.
Pekka
!important does not work. i used it on font-weight and color CSS properties. no effect. as ~Pekka suggested I ended up using a specific attribution
amit
@Pekka: agreed but without the questioner's code shown I could suggest only this.
Sarfraz
A: 

You can't always reliably "unstyle" an element. For some style properties setting the value to auto, default or none will work:

<!doctype html>
<html lang="en">
    <head>
        <title>Test</title>
        <style>
            a { background: pink; }
            a.normal { background: none; }
        </style>
    </head>
    <body>
        <p><a href="#">link1</a>
        <p><a href="#" class="normal">link2</a>
        <p><a href="#">link3</a>
    </body>
</html>

But not for example color. Replace background in above example by color. It won't work. You'll really need to force the color yourself, e.g. color: blue.

BalusC
A: 

post your Code plz

Noam Smadja