使背景图像成为一个有效的链接 [英] Making a background image a working link

查看:57
本文介绍了使背景图像成为一个有效的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用样式表在几页的左上角

中放置一个小的背景图像。是否有一种简单的方法可以制作

图像可点击的链接?谢谢。

I''m using a stylesheet to place a small ''background image'' in the
upper left corner of several pages. Is there a simple way of making
that image a clickable link? Thanks.

推荐答案

Jeff Gillingham于2003年3月30日在

comp.infosystems上写道。 www.authoring.stylesheets:
Jeff Gillingham wrote on 30 nov 2003 in
comp.infosystems.www.authoring.stylesheets:
我正在使用样式表来在几页的左上角放置一个小的背景图像。是否有一种简单的方法可以使图像成为可点击的链接?谢谢。
I''m using a stylesheet to place a small ''background image'' in the
upper left corner of several pages. Is there a simple way of making
that image a clickable link? Thanks.




背景图片不可点击,我可以点击html元素和

如果背景图片是身体的样式,只有身体。


然而你可以创建一个绝对透明的div,其z-index为

比如9999覆盖bg img和所有其他元素并使

可点击:

< body style =" background-image:url(''myimage.gif'');

background-repeat:no-repeat; background-position:left top;">

< div

style =" position:absolute; left: 0; top:0; z-index:9999;

background-color:transparent; width:350px; height:250px;"

onclick =" whatever( )">& nbsp;< / div>


-

Evertjan。

荷兰。

(请将x''es更改为我的电子邮件地址中的点数)



A background image is not clickable, onmy html-elements are clickable and
if the background image is a style of the body, only the body is.

However you can make a position absolute transparent div with a z-index of
say 9999 overlaying the bg img and all other elements and make that
clickable:
<body style="background-image:url(''myimage.gif'');
background-repeat:no-repeat;background-position:left top;">
<div
style="position:absolute;left:0;top:0;z-index:9999;
background-color:transparent;width:350px;height:250px;"
onclick ="whatever()">&nbsp;</div>

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


Jeff Gillingham写道:
Jeff Gillingham wrote:
我正在使用样式表在几页的左上角放置一个小的背景图像。是否有一种简单的方法可以使图像成为可点击的链接?
I''m using a stylesheet to place a small ''background image'' in the
upper left corner of several pages. Is there a simple way of making
that image a clickable link?




如果它可以点击,那么它应该是一个合适的前景图像

替代文字。背景仅供演示。



If its clickable then it should be a foreground image with suitable
alternative text. Backgrounds are for presentation only.


Evertjan。写道:
Evertjan. wrote:
Jeff Gillingham于2003年3月30日在
comp.infosystems上写道。 www.authoring.stylesheets:

Jeff Gillingham wrote on 30 nov 2003 in
comp.infosystems.www.authoring.stylesheets:

我正在使用样式表来放置一个小的背景图片在几页的左上角。是否有一种简单的方法可以使图像成为可点击的链接?谢谢。
I''m using a stylesheet to place a small ''background image'' in the
upper left corner of several pages. Is there a simple way of making
that image a clickable link? Thanks.



背景图片不可点击,我的html元素是可点击的,如果背景图片是身体的样式,只有身体是。
,说9999覆盖了bg img和所有其他元素,并使其可点击:

< body style =" background-image:url(''myimage.gif'');
background-repeat:no-repeat; background-position:left top;">
< div
style =" position:absolute; left:0; top:0; z-index:9999;
background-color:transparent; width:350px; height:250px;"
onclick =" whatever()">& nbsp;< / div>


A background image is not clickable, onmy html-elements are clickable and
if the background image is a style of the body, only the body is.

However you can make a position absolute transparent div with a z-index of
say 9999 overlaying the bg img and all other elements and make that
clickable:
<body style="background-image:url(''myimage.gif'');
background-repeat:no-repeat;background-position:left top;">
<div
style="position:absolute;left:0;top:0;z-index:9999;
background-color:transparent;width:350px;height:250px;"
onclick ="whatever()">&nbsp;</div>



非常聪明。


-

Bill Drescher

bill {at} TechServSys {dot} com


quite clever.

--
Bill Drescher
bill {at} TechServSys {dot} com


这篇关于使背景图像成为一个有效的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆