<!DOCTYPE html>
<html>
<head>
<title>W3.CSS(w3cschool.cn)</title>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<link rel="stylesheet" href="https://7npmedia.w3cschool.cn/w3.css">
</head>
<body>
<div class="w3-container">
<h2>悬停图片</h2>
<p>当您将鼠标移到图像上时,w3-hover-opacity类将为图像添加透明度:</p>
<img src="https://atts.w3cschool.cn/img_snowtops.jpg" class="w3-hover-opacity" alt="Norway" style="width:50%">
<p>当您将鼠标移到图像上时,w3-hover-opacity-off类会重新显示图像的透明度:</p>
<img src="https://atts.w3cschool.cn/img_snowtops.jpg" class="w3-opacity w3-hover-opacity-off" alt="Norway" style="width:50%">
</div>
</body>
</html>