Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Links & Pictures

Reply
Thread Tools

Links & Pictures

 
 
Mikaël Hautin
Guest
Posts: n/a
 
      06-01-2005
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.

 
Reply With Quote
 
 
 
 
Random
Guest
Posts: n/a
 
      06-01-2005
Mikaël Hautin wrote:
> 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>

 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      06-01-2005
Mikaël Hautin wrote:

> 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
maintain, funally there is no alt attribute for the <a> element in any
version of HTML.

> <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?Prob...h_using_frames

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
12-megapixel pictures as sharp when enlarged as 18-meg pictures? Robert Montgomery Digital Photography 95 06-21-2012 01:24 PM
BIG pictures or SMALL pictures ? Albert Digital Photography 11 02-20-2007 02:23 AM
Some graphics/pictures used as links to other sites are not displayed in IE DennisC Computer Support 4 07-12-2004 05:06 AM
Column with pictures instead of 0s and 1s (boolean value representation in pictures) Martin Raychev ASP .Net Datagrid Control 1 03-02-2004 03:00 PM
Sending pictures via email Via OE6+Win XP - I no longer get prompt to "make all my pictures smaller" Ian Roberts Digital Photography 3 09-21-2003 04:57 PM



Advertisments