By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,719 Members | 1,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,719 IT Pros & Developers. It's quick & easy.

Highlighting a Link Destination

P: n/a
Hello everyone,

Is there some way to highlight the destination of a link such as a
definition tag:

<dt><a name="Definition">Definition</a></dt>

Thanks in advance,
Dave White
Mar 11 '07 #1
Share this Question
Share on Google+
13 Replies


P: n/a
Dave White wrote:
>
Is there some way to highlight the destination of a link such as a
definition tag:

<dt><a name="Definition">Definition</a></dt>
I'm not at all clear on what you want. Do you mean that you want the
link to be not just blue and underlined, but also have yellow background
(or something similar) on it?

--
John
Mar 11 '07 #2

P: n/a
On Sun, 11 Mar 2007 06:52:51 +0100, John Hosking
<Jo**@DELETE.Hosking.name.INVALIDwrote:
>Dave White wrote:
>>
Is there some way to highlight the destination of a link such as a
definition tag:

<dt><a name="Definition">Definition</a></dt>

I'm not at all clear on what you want. Do you mean that you want the
link to be not just blue and underlined, but also have yellow background
(or something similar) on it?
I would like to highlight the target of the link

I have a group of terms without definitions in a menu.
These terms all link to their definitions on the same page.

When I click on a link the Term and its definition come into view but
you can also see other terms and definitions.

I would like to highlight the particular term I have selected.

Thanks,
Dave White
Mar 11 '07 #3

P: n/a
Sun, 11 Mar 2007 03:25:47 GMT from Dave White <dj*****@snet.net>:
Hello everyone,

Is there some way to highlight the destination of a link such as a
definition tag:

<dt><a name="Definition">Definition</a></dt>
Certainly. Use CSS.

Whether it's a good idea to highlight a link *destination* is another
question.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Mar 11 '07 #4

P: n/a
Sun, 11 Mar 2007 06:52:51 +0100 from John Hosking
<Jo**@DELETE.Hosking.name.INVALID>:
Dave White wrote:

Is there some way to highlight the destination of a link such as a
definition tag:

<dt><a name="Definition">Definition</a></dt>

I'm not at all clear on what you want. Do you mean that you want the
link to be not just blue and underlined, but also have yellow background
(or something similar) on it?
It's not a link -- <a namerather than <a href>.

Also, 'ware assumptions. Even <a hreflinks may be blue and
underlined on your browser, but they're not on everyone's.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Mar 11 '07 #5

P: n/a
Scripsit Dave White:
When I click on a link the Term and its definition come into view but
you can also see other terms and definitions.

I would like to highlight the particular term I have selected.
That's a natural idea, but there's really no way to implement it in HTML or
CSS. One might think that the destination anchor is "active" at that point,
but current browsers don't interpret the :active pseudo-class in CSS that
way.

On the other hand, normally the destination anchor is positioned at the top
of the canvas ("top of window", loosely speaking), unless it is near the end
of the page. Usually people learn to recognize the top of the canvas as the
place to which the link refers, but admittedly the situation is not clear at
all.

I guess this is one of the reasons for splitting, say, a definition list
into a collection of pages, with a single definition on a page.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 11 '07 #6

P: n/a
On Mon, 12 Mar 2007 00:26:14 +0200, "Jukka K. Korpela"
<jk******@cs.tut.fiwrote:
>Scripsit Dave White:
>When I click on a link the Term and its definition come into view but
you can also see other terms and definitions.

I would like to highlight the particular term I have selected.

That's a natural idea, but there's really no way to implement it in HTML or
CSS. One might think that the destination anchor is "active" at that point,
but current browsers don't interpret the :active pseudo-class in CSS that
way.

On the other hand, normally the destination anchor is positioned at the top
of the canvas ("top of window", loosely speaking), unless it is near the end
of the page. Usually people learn to recognize the top of the canvas as the
place to which the link refers, but admittedly the situation is not clear at
all.

I guess this is one of the reasons for splitting, say, a definition list
into a collection of pages, with a single definition on a page.
Thanks for your input. It would be a nice feature but I can certainly
live without it.

A single definition on a page might be worth it in the long run.

Thanks again,
Dave White
Mar 11 '07 #7

P: n/a
Jukka K. Korpela wrote:
>Scripsit Dave White:
I would like to highlight the particular term I have selected.
That's a natural idea, but there's really no way to implement it in HTML
or CSS. One might think that the destination anchor is "active" at that
point, but current browsers don't interpret the :active pseudo-class in
CSS that way.
Perhaps just a curiosity, but it seems that IE6 does, as long as the
destination is marked as a link. E.g.:

<style media="screen" type="text/css">
:active {
background-color:yellow;
color:blue;
}
</style>

<dd><a id="foo" href="#bar">The definition or highlited part wrapped in
a link.</a></dd>

Drop the href attribute to stop it working :)

Osmo

Mar 12 '07 #8

P: n/a
In article <6h********************************@4ax.com>,
Dave White <dj*****@snet.netwrote:
>Hello everyone,

Is there some way to highlight the destination of a link such as a
definition tag:

<dt><a name="Definition">Definition</a></dt>
CSS3 proposes the target pseudo-class; The following works in Firefox

<html>
<head>
<title>Sample target</title>
<style type="text/css">
div:target {background-color: yellow}
</style>
</head>
<body>
<a href="#a">a</a<a href="#b">b</a>
<div id="a">This is the target of a</div>
<div id="b">This is the target of b</div>
</body>
</html>

John
--
John P Baker
Mar 12 '07 #9

P: n/a
Scripsit Osmo Saarikumpu:
>That's a natural idea, but there's really no way to implement it in
HTML or CSS. One might think that the destination anchor is "active"
at that point, but current browsers don't interpret the :active
pseudo-class in CSS that way.

Perhaps just a curiosity, but it seems that IE6 does, as long as the
destination is marked as a link.
An interesting phenomenon. When you follow a link to such an anchor, IE
focuses on the link in the anchor, and IE interprets :active to some extent
the way :focus should be interpreted.
<dd><a id="foo" href="#bar">The definition or highlited part wrapped
in a link.</a></dd>
Then you have the problem that it _is_ a link, and it's difficult to hide
that. Sometimes it could really be a link (to a more detailed definition,
for example), but as a rule, this looks too contrived.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 12 '07 #10

P: n/a
Dave White wrote:
Is there some way to highlight the destination of a link such as a
definition tag:

<dt><a name="Definition">Definition</a></dt>
http://dorward.me.uk/software/frag/
--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Mar 13 '07 #11

P: n/a
Scripsit David Dorward:
>Is there some way to highlight the destination of a link such as a
definition tag:

<dt><a name="Definition">Definition</a></dt>

http://dorward.me.uk/software/frag/
The page seems to describe a JavaScript way to simulate the :target
pseudo-class in a manner that works on most browsers. Looks good, though
somewhat complicated technically.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 13 '07 #12

P: n/a

David Dorward wrote:
Dave White wrote:
Is there some way to highlight the destination of a link such as a
definition tag:

<dt><a name="Definition">Definition</a></dt>

http://dorward.me.uk/software/frag/

For those who run under MacOS it may be worth noting that the browser
iCab (http://www.icab.de/) does something rather similar
automatically, without any need for Javascript or anything special in
the HTML. The main difference is that the highlighting is transitory:
you see it immediately after following the link, but then it fades. I
find it very helpful for seeing where a link has taken me, but of
course it's not really a solution to the OP's problem, as most of his
readers won't be using iCab.

athel

Mar 14 '07 #13

P: n/a
at******@yahoo.co.uk wrote:
For those who run under MacOS it may be worth noting that the browser
iCab (http://www.icab.de/) does something rather similar
automatically, without any need for Javascript or anything special in
the HTML.
And something at least vaguely resembling such functionality happens
with FF when browsing with caret enabled

URL: about:config
Set: accessibility.browsewithcaret value to "true"

Osmo
Mar 14 '07 #14

This discussion thread is closed

Replies have been disabled for this discussion.