<!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>当您将鼠标悬停在按钮上时,背景颜色将变为灰色</p>
<p>如果要改为更改文本颜色,请使用<strong>w3-hover-none</strong>类关闭默认的悬停效果,然后添加<strong>w3-hover-text</strong>类::</p>
<div class="w3-bar w3-border w3-black">
<a href="#" class="w3-bar-item w3-button">默认</a>
<a href="#" class="w3-bar-item w3-button w3-hover-none w3-text-grey w3-hover-text-white">链接 1</a>
<a href="#" class="w3-bar-item w3-button w3-hover-none w3-text-grey w3-hover-text-white">链接 2</a>
<a href="#" class="w3-bar-item w3-button w3-hover-none w3-text-grey w3-hover-text-white">链接 3</a>
</div>
</div>
</body>
</html>