473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Highlighting target links within a document

While using the following to self link documents

<a name="NAME"></a>

<a href="#NAME"></a>

Is there a way to dynamicaly bold, underline, or highlight the target
<a name="NAME"></a> once the link has been clicked. Does anyone know
of a html or javascript method of accomplishing this ?
Any help is appreciated.

- Eric
Jul 20 '05 #1
4 2206
Charon:
Is there a way to dynamicaly bold, underline, or highlight the target
<a name="NAME"></a> once the link has been clicked. Does anyone know
of a html or javascript method of accomplishing this ?
Any help is appreciated.


Since "<a name="NAME"></a>" doesn't have any content, there's not much
to bold, underline or highlight, is there?

But if there is content, you can try the CSS3 pseudoclass ":target", e.g.:

:target { font-weight: bold; text-decoration: underline; }

It will work in Mozilla/Firebird, probably also in Safari, possibly in
Opera.

--
Bertilo Wennergren <be******@gmx.net> <http://www.bertilow.com>

Jul 20 '05 #2
Charon wrote:
While using the following to self link documents

<a name="NAME"></a>

<a href="#NAME"></a>

Is there a way to dynamicaly bold, underline, or highlight the target
<a name="NAME"></a> once the link has been clicked. Does anyone know
of a html or javascript method of accomplishing this ?


<http://dorward.me.uk/software/frag/> (but you have to switch from name to
id)

--
David Dorward http://dorward.me.uk/
Jul 20 '05 #3
Charon wrote:
While using the following to self link documents

<a name="NAME"></a>

<a href="#NAME"></a>

Is there a way to dynamicaly bold, underline, or highlight the target
<a name="NAME"></a> once the link has been clicked.
Such a thing is possible using css 3's :target pseudo-class. Using
your second html example above, place the following in your styles:

a#name:target {
font-weight: bold;
}

Note that css 3 is only a recommendation at this point. However,
Mozilla already supports part of it, including :target. Opera may, as
well.
Does anyone know of a html
html is a structural markup language, and has no formal way to color
anything.
or javascript method of accomplishing this ?


There is possibly a js means, but I don't know much about js. Try a
js newsgroup.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #4
Brian wrote:
Charon wrote:
While using the following to self link documents

<a href="#NAME"></a>

Is there a way to dynamicaly bold, underline, or highlight the target


Such a thing is possible using css 3's :target pseudo-class. Using
your html example above, place the following in your styles:

a#name:target {
font-weight: bold;
}


oops. That's bogus. The above css declaration would work with an id,
but not the a href="name" contruct given. Sorry. Try something like

<a href="foo.html" id="name">foo resource</a>

Here's a better example:

<h2 id="name">project name</h2>

#name:target {
font-weight: bold;
}

better still:

<ul id="toc">
<li><a href="#name">project name</a></li>
<li><a href="#goal">project goals</a></li>
<li><a href="#timeline">project timeline</a></li>
</ul>

<h2 id="name">project name</h2>
<!-- content -->

<h2 id="goal">project goals</h2>
<!-- content -->

<h2 id="timeline">project timeline</h2>
<!-- content -->

h2:target {
font-weight: bold;
}

--
Brian
follow the directions in my address to email me

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Mark van Ballegooijen | last post by:
When using the XHTML 1.0 validator at http://validator.w3.org/check, an error will be raised for every instance of a "target" attribute in "A" elements. Is it truely because it is not part of this...
9
by: Muffinman | last post by:
Hi, I have a webpage with two Iframe's. I want to be able to change the target of all links in one frame so it will point to the other frame and all this from the main page. Is this possible and...
4
by: Mel | last post by:
i Have: <script language=JavaScript>document.location=http://www.xxx.com</script> how can i specify "target=_top" in above script ? thanks
3
by: Ptaku25 | last post by:
I have in a few first page defined links (font blue color) row by row which are links for to appropriate pages in this pdf document. Could you tell how to get this links in javascript lang ???...
1
by: mikename | last post by:
Hi, I'm currently working on a project which is essentially a clickable world map. I have successfully mapped the image and using a OnMouseOver = "Continent()" OnMouseOut = "World()" command in...
3
by: GreggTB | last post by:
I've looked online for a while but haven't found a whole lot of really good resources for this, so I'm hoping that maybe someone here can point me in the right direction. I'm working with a 3rd...
1
by: Gerald Shastri | last post by:
Hi, I have a page which is being generated by a CMS and I can't control the links which are being outputted. I want to add a target = "_parent" attribute to all the links on my page using...
19
by: Moon | last post by:
Bergamot wrote in <6i534eFolqk5U1@mid.individual.net>: Done! http://moon.descentforum.net/creep/ with 2 issues though: I liked the funtionality of target="_blank", so people that are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.