HighDots Forums  

Re: Links & Pictures

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Links & Pictures in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David Dorward
 
Posts: n/a

Default Re: Links & Pictures - 06-01-2005 , 04:45 AM






Mikaël Hautin wrote:

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

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

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

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

Quote:
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
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.