473,395 Members | 1,516 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,395 software developers and data experts.

Links & Pictures

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.

Jul 23 '05 #1
2 2337
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>

Jul 23 '05 #2
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
Jul 23 '05 #3

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

Similar topics

12
by: Bunset | last post by:
i dont know what is more eficient, What do you think is better, put in pictures physically in records in database or put in links to pictures in records? Thank you.
0
by: Thomas Scheffler | last post by:
Hi, I runned in trouble using XALAN for XSL-Transformation. The following snipplet show what I mean: <a href="http://blah.com/?test=test&amp;test2=test2">Test1&amp;</a> <a...
0
by: Jason | last post by:
I have been trying to display pictures on my webpage on both imagebutton and image controls. I have tried adding the pictures at runtime (image1.imageURL = "pic.jpg") and setting the imageURL in...
0
by: Fenno | last post by:
I have an ASP.NET web application that contains some pictures that sometimes take several seconds to load. These pictures are contained in user controls on the page (if that makes any difference)....
0
by: Roula | last post by:
Ok folks, we've recently added 1 click links to over 45 Oscar Sites, PLUS, we've now added Nominee Interviews,and Articles, and we're constantly adding to the mix! There are also industry blogs,...
1
by: PengYu.UT | last post by:
There has been some lengthy discussion on pros and cons of Word and Latex on the web. But for drawing figure there are also two set of packages metapost and powerpoint(visio). I don't see much...
2
by: sebastian.janoschka | last post by:
Hi, I build my first Drag & Drop with JavaScript and I would like to drag the pictures when I click on it. When I create a normal div tag with some text the script works, but when I put a...
1
by: boclair | last post by:
I have been asked to assist some Veterans to overcome a problem they are having in IE6 with the behaviour of internal links on some pages they have written. Background Their schema is to...
0
by: eBob.com | last post by:
Here's how I insert and size pictures in an Excel spreadsheet which I create via a VB.NET program (commentary follows): 'add thumb nail objSheet.Rows(XLRow.ToString).rowheight =...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.