On 1 Mai, 18:10, Thierry <[email protected]> wrote:
> I current have a bunch of styling for
>
> a {}
> a:visited {}
> a:hover {}
>
> I also have a new set of hyperlinks for which I don't want to use the
> above:
>
> <a href="" class="outside"></a>
>
> How can I make my "a" tags with class "outside" not inherit existing
> styles for it?

You can't. You have to reset the styles. Don't forget to reset the
styles for the :link psaudo class too.

The exisense of psaudo classes is in some cases based on user
interaction. Two or more psaudo classes can exist at the same time. To
avoid that one psaudo class override styles of another psaudo class in
an unwanted way, you should specifiy those in an certain order. An
order that is often mentioned is; link, visited, hover, focus and
active.

This is easy to mess up, but your reset styles could look something
like this:

a.outside:link,  { color: blue;  text-decoration: underline }
a.outside:visited { color: purle; text-decoration: underline } /*
purple or in some browsers red */
a:outside:hover {}
a.outside:focus { outline: thin dotted invert }
a.outside:active {}

and

#first a:link { color: blue; text-decoration: underline }
... etc.

The a selector alone, without the :link psaudo will then apply to
anchor (a) elements without the href attribute.

--~--~---------~--~----~------------~-------~--~----~
--
You received this because you are subscribed to the "Design the Web with CSS" 
at Google groups.
To post: [email protected]
To unsubscribe: [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to