在背景图像上使用CSS的图像超链接 - 可能吗? [英] Image hyperlinks using CSS on a background image - possible?

查看:143
本文介绍了在背景图像上使用CSS的图像超链接 - 可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在尝试创建一个CSS驱动的网站,因为我想要

能够控制显示/内容来自CSS文件。我不想要

来使用表格。


在页面上,我有一个背景图片(包含较小的图片)

我希望将较小的图像指定为超链接。


最好的方法是什么?我知道我可以使用图像映射,但是使用CSS有更好的方法吗?在此先感谢。


AIM

Hi,

I am attempting to create a CSS-driven website, in that I want to be
able to control the display/content from the CSS file. I do not want
to use tables.

On a page, I have a background image (that contains smaller images)
and I would like to assign the smaller images as hyperlinks.

What is the best way to do this? I know I can use an imagemap, but is
there a better way using CSS? Thanks in advance.

AIM

推荐答案

/ Imran /:
/Imran/:
在页面上,我有一个背景图片(包含较小的图像)
我想将较小的图像指定为超链接。


也许你误用了背景图片一词。虽然样式

表可以声明特定元素的背景图像,但是它b / b仅用于装饰目的(它可以没有它),

但似乎你的图像具有功能和内容的作用。

最好的方法是什么?我知道我可以使用imagemap,但有没有更好的方法使用CSS?在此先感谢。
On a page, I have a background image (that contains smaller images)
and I would like to assign the smaller images as hyperlinks.
Perhaps you''re misusing the term ''background image''. While the style
sheet could declare a background image for a particular element, it
is meant for decorative purpose, only (it could live without it),
but like it seems your image has a functional and content role.
What is the best way to do this? I know I can use an imagemap, but is
there a better way using CSS? Thanks in advance.




最好的方法是使用图像映射。一定要为图像指定

替代内容,对于它使用的MAP的AREA

元素更重要:


< AREA alt =" Home" ...

< AREA alt ="搞笑事物" ...

< AREA alt =" More Stuff" ...


BTW,这个功能性图像的外观在哪些方面你希望通过样式表来控制?b $ b图像本身有一个很好的单向外观。


-

Stanimir



The best way is just using "image map". Be sure to specify
alternative content for the image and more important to the AREA
elements of the MAP it uses:

<AREA alt="Home" ...
<AREA alt="Funny Things" ...
<AREA alt="More Stuff" ...

BTW, what aspects of the appearance of this functional image map you
expect to control through a style sheet? The image itself has a
pretty one way appearance.

--
Stanimir


感谢Stanimir的快速回复。


我在与有需要的朋友简短地交谈之后发布了请求,而且我完全得到了
棒的错误结束。


我/我的朋友实际需要的是能够包含超链接

(< a href ...> )在外部样式表中。例如,我想

能够在样式表中声明图像并将其设置为超链接,

而无需使用< a href ... >在HTML源代码中。

这可能吗?谢谢。


问候,


AIM


Stanimir Stamenkov< s7 **** @ netscape.net>在消息新闻中写道:< c5 ************* @ ID-207379.news.uni-berlin.de> ...
Thanks for the quick response Stanimir.

I posted the request after briefly speaking to a friend in need, and I
totally got the wrong end of the stick.

What I/my friend actually require is the ability to include hyperlinks
(<a href...>) within an external stylesheet. For example, I want to
be able to declare an image in a stylesheet and set it as a hyperlink,
without the need for using <a href...> within the HTML source. Is
this possible? Thanks.

Regards,

AIM

Stanimir Stamenkov <s7****@netscape.net> wrote in message news:<c5*************@ID-207379.news.uni-berlin.de>...
/ Imran /:
/Imran/:
在页面上,我有一个背景图像(包含较小的图像)
我想将较小的图像指定为超链接。
On a page, I have a background image (that contains smaller images)
and I would like to assign the smaller images as hyperlinks.



也许你误用了背景图片一词。虽然样式
表可以声明特定元素的背景图像,但它仅用于装饰目的(它可以没有它),但是好像你的图像似乎有一个功能和内容角色。



Perhaps you''re misusing the term ''background image''. While the style
sheet could declare a background image for a particular element, it
is meant for decorative purpose, only (it could live without it),
but like it seems your image has a functional and content role.

最好的方法是什么?我知道我可以使用imagemap,但有没有更好的方法使用CSS?在此先感谢。
What is the best way to do this? I know I can use an imagemap, but is
there a better way using CSS? Thanks in advance.



最好的方法是使用图像映射。请务必为图像指定
替代内容,并对其使用的MAP的AREA
元素更为重要:

< AREA alt =" Home" ...
< AREA alt ="搞笑事物" ...
< AREA alt =" More Stuff" ...

BTW,您期望通过样式表控制的功能图像地图的外观有哪些方面?图像本身具有漂亮的单向外观。



The best way is just using "image map". Be sure to specify
alternative content for the image and more important to the AREA
elements of the MAP it uses:

<AREA alt="Home" ...
<AREA alt="Funny Things" ...
<AREA alt="More Stuff" ...

BTW, what aspects of the appearance of this functional image map you
expect to control through a style sheet? The image itself has a
pretty one way appearance.



Imran写道:

例如,我想
能够在样式表中声明图像并将其设置为超链接,
而无需使用< a href ...>在HTML源代码中。
这可能吗?

For example, I want to
be able to declare an image in a stylesheet and set it as a hyperlink,
without the need for using <a href...> within the HTML source. Is
this possible?




编号除了极少数情况,CSS仅用于演示,而不是内容。

超链接是内容。您可以使用CSS更改超链接的外观

,或者完全隐藏它,但这就是它。


-

回复地址是无底垃圾邮件桶。

请回复群组,以便每个人都可以共享。



No. Except in rare cases, CSS is only for presentation, not content. A
hyperlink is content. You can change the appearance of the hyperlink
using CSS, or hide it altogether, but that''s about it.

--
Reply address is a bottomless spam bucket.
Please reply to the group so everyone can share.


这篇关于在背景图像上使用CSS的图像超链接 - 可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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