我希望将鼠标悬停在图像上时,图像的尺寸会稍微变大。我知道这很简单,但我已经在其他示例中寻找了一个小时,但似乎无法弄清楚我遗漏了什么。感谢您的帮助。这些图片保存在我的电脑上。
适用范围
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<embed src="73797^alarmclock.mp3"; autostart="true"; loop="true"; hidden="true";/>
<body>
<img src ="alarm clock2.jpg"/>
<p> Pulling the sheets into my body, I begin to sink back into the bed...
uggh... my alarm clock... time to get up..
<img style = "position:absolute; top:300px; right: 0px; z-index:1"
src="computer.jpg"/>
<IMG ID="grow" STYLE= "position:absolute; TOP:1157px; LEFT:599px;
WIDTH:47px; z-index:2; HEIGHT:47px" SRC="icon2.gif"/>
</body>
</html>
这是 stylesheet.css
#grow:hover {
width: 100px;
height: 150px;
}
最佳答案
我认为内联样式优先于 CSS。
将您的 CSS 和 HTML 更改为以下内容:
#grow {
position:absolute;
top:1157px;
left:599px;
width:47px;
z-index:2;
height:47px
}
#grow:hover {
width: 100px;
height: 150px;
}
HTML:
<IMG ID="grow" SRC="icon2.gif"/>
关于css悬停不执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18518055/