<!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><strong>w3-mobile</strong>类定义响应元件。</p>
<p>在中型和大型屏幕(平板电脑和台式机)上,条形项目将水平并排出现。在小屏幕(智能手机)上,项目垂直且居中:</p>
<p><strong>调整浏览器窗口的大小以查看效果。</strong></p>
<p>默认导航栏:</p>
<div class="w3-bar w3-black">
<a href="#" class="w3-bar-item w3-button">主页</a>
<a href="#" class="w3-bar-item w3-button">链接 1</a>
<a href="#" class="w3-bar-item w3-button">链接 2</a>
<a href="#" class="w3-bar-item w3-button">链接 3</a>
</div>
<p>响应式导航栏:</p>
<div class="w3-bar w3-black">
<a href="#" class="w3-bar-item w3-button w3-mobile">主页</a>
<a href="#" class="w3-bar-item w3-button w3-mobile">链接 1</a>
<a href="#" class="w3-bar-item w3-button w3-mobile">链接 2</a>
<a href="#" class="w3-bar-item w3-button w3-mobile">链接 3</a>
</div>
</div>
</body>
</html>