不同的链接CSS悬停改变图片
我想要 CSS 悬停影响影响同一图像的多个链接。如果您查看此示例站点,我会提供修复、销售、升级和数据恢复链接。当您将鼠标悬停在其中任何一个上时,我希望它们左侧的图像发生变化。您可以将鼠标悬停在当前图像上以了解我的意思。
I would like a CSS hover affect for multiple links that affect the same image. If you look at this example site I have Repair, Sales, Upgrades and Data Recovery links. When you hover over any one of them I would like the image to their left to change. You can hover over the image currently there to see what I mean.
website: http://ctuchicago.squarespace.com/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我将创建一个包含图像和所有链接的框。然后,当该框悬停在图像上时,图像将会发生变化。这并不能让你得到你想要的东西 - 只是将鼠标悬停在链接上会改变图像,但我认为它足够接近并且更容易。
http://jsfiddle.net/mrtsherman/D5ZRs/
I would create a box that contains the image and all of the links. Then when the box is hovered over the image will change. This doesn't get you exactly what you want - which is only hovering over the link changes the image, but I think it is close enough and far easier.
http://jsfiddle.net/mrtsherman/D5ZRs/
将图像放入
a
标记内。然后使用position:relative
来定位图像...例如
Put the image inside the
a
tag. Then useposition: relative
to position the image...for example
这似乎有效...部分 XD
基本思想是将您的内容放在 a 标签中(就像人们所说的那样)。
我对样式所做的是将锚点设置为 width:auto 并将内容包装在 div 中。然后我给这个div的高度为80px,左边距为81px,背景为白色,字体颜色为黑色。
This seems to work... partially XD
The basic idea is to have your content in the a tag (like ever body has been saying).
What I've done with the styling is set the anchor to width:auto and wrapped the content in a div. this div I then gave a height of 80px, left margin of 81px, background of white and font color of black.
将
和
标签包裹在
标签内。
Wrap the
<p>
, and<h3>
tags inside the<a>
tags.