【发布时间】:2018-02-18 11:17:48
【问题描述】:
我正在尝试创建一个可以改变图片的悬停。很多教程告诉我尝试 onmouseover 和 onmouseout。但是 Brackets(我用来编码的程序)无法找到名为“test2.png”的第二张图片。有谁知道我该如何处理这个问题,最好只使用 HTML。
以下是我观看的教程,展示了我想要实现的目标:
https://www.youtube.com/watch?v=qtpa_r1ILjo
https://www.youtube.com/watch?v=y4RJDUI7M8Y
<!DOCTYPE html>
<html>
<head>
<title>Portfolio V1</title>
<link rel="stylesheet" type="text/css" href="main.css"/>
<script type="text/javascript"></script>
</head>
<body>
<img src="images/test1.png" onmouseover="this.src=images/test2.png" onmouseout="this.src='test1.png'" >
</body>
</html>
【问题讨论】:
标签: html hover transition onmouseover onmouseout