Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<A> hotspot region 1

Status
Not open for further replies.

louistaub

Programmer
Sep 21, 2001
20
0
0
GB
Does anyone know how to increase the clickable region of the <a> tag. I need it to work in both IE5+ and Netscape 6.

Thanks

Louis
 
Hi Louis,

you could add some leading and trailing spaces either side of the link text??

Code:
<A HREF=&quot;page1.htm&quot;>&ampnbsp;Link Text&ampnbsp;</A>

or are you linking with an image? or table cells? or <DIV> tags?? Can you explain more about what you are trying to do so we can help more.

Tony
 
Hi louistaub,

Try this:

<a href=&quot; style=&quot;cursor:hand; border:1px solid; padding-top: 20px; padding-bottom: 10px; padding-left: 10px; padding-right: 40px; width:100px; &quot;>testlink</div></a>

I added the border so you can see the dimensions.
I can't test NS6 here (I'm not sure if the cursor:hand is supported)

Hope this helps,
Erik
<!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
Thanks Erik that was exactly what I needed and that solution works with Netscape 6 as well.

Thanks again

Louis
 
Just being picky here i guess but it is invalid syntax to place a div inside an anchor tag. The correct way to do this would be to have the anchor inside the div and then using css set the display property of the anchor to block like this
Code:
<div><a href=&quot;#&quot; style=&quot;display:block&quot;>link</a></div>
This will force tha nchor to fill the div inthe x direction as if it was itself a block level element recreating the effect above whilst maintaining valid html.

This will work for all browser version 5 and above. It wont stop it working in netscape 4 but it wont increase the hit area of the anchor. I dont see that this matters. If something is usable in NS4 that is good enough for me.

hope this helps

rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top