Links & Pictures

M

Mikaël Hautin

Hi there,

I'm Mikaël Hautin, a new one to this newsgroup. I will show you how to
get rid of <a> tags to put links on pictures.

When you want to put a link to another page on a picture, you type this
kind of HTML code :

<a href="page.html" style="text-decoration:none;" alt="funny things
....">
<img src="img12.gif" alt="funny things ..." border="0">
</a>

But when you click on the image, you can see a dotted border around it.

If you type this instead :

<img src="img12.gif" alt="funny things ..." border="0"
onclick="this.location='page.html';" style="cursor:hand;">

I think it is better, especially when you have frames in your website.

Voilà !

PS : forgive my english.
 
R

Random

Mikaël Hautin said:
Hi there,

I'm Mikaël Hautin, a new one to this newsgroup. I will show you how to
get rid of <a> tags to put links on pictures.

When you want to put a link to another page on a picture, you type this
kind of HTML code :

<a href="page.html" style="text-decoration:none;" alt="funny things
...">
<img src="img12.gif" alt="funny things ..." border="0">
</a>

But when you click on the image, you can see a dotted border around it.

If you type this instead :

<img src="img12.gif" alt="funny things ..." border="0"
onclick="this.location='page.html';" style="cursor:hand;">

I think it is better, especially when you have frames in your website.

Voilà !

PS : forgive my english.

Bad idea as it reduces the accesibility of the web page to people who
are not using pointing devices, have textual browsers, turned off
images, et cetera.

What's wrong with dotted borders? They show up even on textual links,
you know, and they do serve a purpose.

But if you really want to get rid of it:
<a href=my.uri onClick=this.blur() ><img ... /></a>
 
D

David Dorward

Mikaël Hautin said:
When you want to put a link to another page on a picture, you type this
kind of HTML code :

<a href="page.html" style="text-decoration:none;" alt="funny things
...">

No I don't. For a start its almost always a really bad idea to remove
underlines from text links, secondly inline style is nasty and hard to
<img src="img12.gif" alt="funny things ..." border="0">

Again, no. I wouldn't use the border attribute, its presentational and its
task should be relegated to CSS. I would, on the other hand, specify the
width and the height so that browsers can produce a suitably sized
placeholder until they have the image downloaded.
But when you click on the image, you can see a dotted border around it.

The shock! The horror! The user agent tells the user that the image has
focus, thus giving them helpful visual feedback to let them know that they
have clicked on the image (as opposed to missing with the pointer or not
pressing the mouse button hard enough). Then, half a second later, it goes
away as the next page loads.
If you type this instead :

<img src="img12.gif" alt="funny things ..." border="0"
onclick="this.location='page.html';" style="cursor:hand;">

Still missing the height and width, and still using inline style. "Hand"
isn't among the values that the cursor property takes in CSS, you probably
mean "pointer". Of course now, as the image isn't a link, you can't give it
the focus, so anybody using a non-pointing device (such as a keyboard)
won't be able to activate it.

.... and GoogleBot won't be able to follow it.

.... and it won't appear in a list of links with many browsers can generate
for their users on demand.

.... and it won't work if the user can't or won't use JavaScript.
I think it is better, especially when you have frames in your website.

http://www.allmyfaqs.com/faq.pl?Problems_with_using_frames
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top