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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling cursor via external style sheet?

Status
Not open for further replies.

LEICJDN1

Technical User
Nov 27, 2002
201
GB
Hi,

My web pages link to my external CSS via:

<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../main.css&quot; title=&quot;Default&quot;>

When a user clicks on the thubnails on the page, a new window with a larger version of the image loads via Javascript thus:

<span onClick=javascript:window.open(&quot;largeimage.gif&quot;,&quot;blank&quot;,&quot;toolbar=no,width=250,height=250&quot;)><img src=&quot;small.gif&quot; alt=&quot;Click for large image&quot; class=&quot;right&quot;></span>

How can I define a class in my external CSS, and then add this class to the <span> so that the cursor becomes a hand as it passses over the image, indicating it is a link and can be clicked?

Thanks!
 
Add the following style attribute to your <span> or <image> tag:

style=&quot;cursor: hand&quot;
 
Surely the easiest way to make the image behave as a link is, errm, to make it a link. Like this:

[tt]<a href=&quot;#&quot; onClick=javascript:window.open(&quot;largeimage.gif&quot;,&quot;blank&quot;,&quot;toolbar=no,width=250,height=250&quot;)><img src=&quot;small.gif&quot; alt=&quot;Click for large image&quot; class=&quot;right&quot;></a>[/tt]



-- Chris Hunt
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top