<!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-sidebar w3-bar-block w3-collapse w3-card w3-animate-left" style="width:200px;" id="mySidebar">
<button class="w3-bar-item w3-button w3-large w3-hide-large" onclick="w3_close()">Close ×</button>
<a class="w3-bar-item w3-button" href="#">链接 1</a>
<a class="w3-bar-item w3-button" href="#">链接 2</a>
<a class="w3-bar-item w3-button" href="#">链接 3</a>
</div>
<div class="w3-main" style="margin-left:200px">
<div class="w3-teal">
<button class="w3-button w3-teal w3-xlarge w3-hide-large" onclick="w3_open()">☰</button>
<div class="w3-container">
<h1>我的主页</h1>
</div>
</div>
<div class="w3-container">
<h3>响应式侧边栏</h3>
<p>在此示例中,边栏将始终显示在大于992px的屏幕上,并始终隐藏在平板电脑或移动电话(小于993px的屏幕)上。</p>
<p>在平板电脑和手机上,边栏被菜单图标代替,以打开边栏。</p>
<p>侧边栏将覆盖页面内容。</p>
<p><b>调整浏览器窗口的大小以查看其工作方式。</b></p>
</div>
</div>
<script>
function w3_open() {