【发布时间】:2015-12-16 20:38:39
【问题描述】:
试图让我的代码在“spiral.svg”悬停时将背景图像更改为“color.jpg”。我想我越来越近了,肯定错过了一些东西,但不确定那是什么!
HTML
<div class ="spiral">
<img src="spiral.svg">
</div>
CSS
img {
max-width: ???;
max-height: ???;
}
.spiral:hover {
background:url('color.jpg') center;
z-index: some positive number higher than my orig background image?
}
body {
background:url('orig.jpeg') center;
z-index: -60;
}
【问题讨论】:
-
z-index在指定position时有效。
标签: css background hover background-image mousehover