a:link, a:visited, a:active {text-decoration:none;}
a:hover {text-decoration:underline;}
Is there a way to differentiate:
<a name="itemname">item reference</a>
from:
<a href=http://linktosite/pagename>item link description</a>
I've tried using empty <a name="itemname></a> tags, but for some
reason validation fails when that occurs.
My goal is to prevent the underline text-decoration on <a name=""> tags.
Any suggestions are greatly appreciated.
Jim Carlock
Post replies to the group.
That's an odd way to write this. You might want to read
http://dbaron.org/css/1999/09/links.
But in short, you should use:
:link, :visited { text-decoration: none; }
:link:hover, :visited:hover { text-decoration: underline; }
per the CSS standards:
a[name] { text-decoration:none; }
but it doesn't work with browsers that support CSS poorly.
"Christian Biesinger" <cbies...@web.de> replied:
> That's an odd way to write this. You might want to read
> http://dbaron.org/css/1999/09/links.
>
> But in short, you should use:
>
> :link, :visited { text-decoration: none; }
> :link:hover, :visited:hover { text-decoration: underline; }
Thanks, Christian. That works pretty well in two PC browsers (IE6
and Mozilla Gecko Firefox 1.04). Not sure what the problem is with
Amaya, though. Amaya displays problems not only with the links, but
also seems to carry problems with margin:auto; (centering block items
fails). Maybe they're the bugs that the W3 folks refer to as CSS bugs(?).
The link you provided above, indicates the following:
<http://dbaron.org/css/1999/09/links>
a:link, a:visited
This needlessly restricts the link elements being matched to links
created using HTML's a element (as opposed to XML links).
</http://dbaron.org/css/1999/09/links>
What exactly is an XML link? Is that an XML tag with an href="any"
qualifier inside the tag? Or would a an XML link qualify as any
network path, drive:/folder/file.ext path, et al. Would you know?
Thanks much for the information.
Jim Carlock
A link made using XLink (http://www.w3.org/TR/xlink/), for example:
<foo xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
xlink:href="http://www.mozilla.org">An XML Link</foo>
a.one:link ,a.one:visited
{
text-decoration: none;
}
a.two:link
{
text-decoration:underline;
}
<a href="#foo" class="one" >go to foo</a><br />
<a href="HTMLPage.htm" class="two">Some page</a><br />
<div id="foo">Foo section</div>
Instead of using <a name="">, use ids.
E.g., <h2 id="section2">Section 2</h2>
...
<a href="#section2">link to section 2</a>
You may also want respecify the underline for href links, incase you get
both like so: <a href="somelink" name="somename">Sometext</a> At the
moment this would not have an underline.
This ought to make it so only pure <a name="somename"></a> tags have
their underline removed.
a[name]{ text-decoration: none; }
a[href]{ text-dectoration: underline; }