On Fri, Mar 4, 2011 at 11:37 AM, David Cramer <[email protected]> wrote:
> Hi all,
> I've face this problem myself, in particular with the <a> element and xhtml
> output. The trick is to use pseudoclasses so your rule only applies only to
> links and not to anchors:
>
> a:link    {
>     color: #00589E;
>     }

I just got another trick from someone who works with CSS fairly
regularly. He suggested this:

  a[href] {
      color: purple;
  }

I didn't realize that CSS can select by attribute using square bracket
syntax. I had tried the pseudoclass technique earlier and found that
using a:hover and a:active would style the non-link content also.
a[href]:hover and a[href]:active seem to style only the actual links
now.

So I'm using XHTML again.

Thanks for your help.

Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to