<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.cn/w3css/4/w3.css">
<body>
<div class="w3-container">
<h2>悬停颜色</h2>
<p>您可以使用任何悬停颜色来设置栏的样式:</p>
<p>将鼠标悬停在栏目上可以看到效果:</p>
<div class="w3-bar w3-black">
<div class="w3-bar-item w3-hover-red">伦敦</div>
<div class="w3-bar-item w3-hover-green ">巴黎</div>
<div class="w3-bar-item w3-hover-blue">东京</div>
</div>
<br>
<div class="w3-bar-block w3-black" style="width:120px">
<div class="w3-bar-item w3-hover-red">伦敦</div>
<div class="w3-bar-item w3-hover-green ">巴黎</div>
<div class="w3-bar-item w3-hover-blue">东京</div>
</div>
</div>
</body>
</html>