472,142 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,142 software developers and data experts.

Highlighting a Link Destination

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
13 6492
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
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
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
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
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
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
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
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
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
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
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

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
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.

Similar topics

9 posts views Thread by Jay Davis | last post: by
4 posts views Thread by HKannen | last post: by
1 post views Thread by John Doe | last post: by
4 posts views Thread by Bob hotmail.com> | last post: by
1 post views Thread by chris | last post: by
1 post views Thread by mikename | last post: by
5 posts views Thread by Robertcode | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.