Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question about CSS, <a href> tags, <a name> tags

3 views
Skip to first unread message

Jim Carlock

unread,
Feb 17, 2006, 9:21:48 PM2/17/06
to
This is not really a mozilla specific issue (maybe).

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.


Christian Biesinger

unread,
Feb 17, 2006, 9:54:33 PM2/17/06
to
Jim Carlock wrote:
> a:link, a:visited, a:active {text-decoration:none;}
> a:hover {text-decoration:underline;}

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; }

C A Upsdell

unread,
Feb 17, 2006, 11:56:39 PM2/17/06
to

per the CSS standards:

a[name] { text-decoration:none; }

but it doesn't work with browsers that support CSS poorly.

Jim Carlock

unread,
Feb 18, 2006, 4:09:44 PM2/18/06
to
Jim Carlock posted:

> a:link, a:visited, a:active {text-decoration:none;}
> a:hover {text-decoration:underline;}

"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


Christian Biesinger

unread,
Feb 18, 2006, 5:00:35 PM2/18/06
to
Jim Carlock wrote:
> What exactly is an XML link?

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>

Lashdex

unread,
Feb 21, 2006, 1:01:07 AM2/21/06
to

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>

dolphinling

unread,
Feb 21, 2006, 12:40:48 PM2/21/06
to

Instead of using <a name="">, use ids.

E.g., <h2 id="section2">Section 2</h2>

...

<a href="#section2">link to section 2</a>


us...@domain.invalid

unread,
Feb 24, 2006, 2:43:13 AM2/24/06
to
> per the CSS standards:
>
> a[name] { text-decoration:none; }
>

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; }

0 new messages