<!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>要突出显示用户当前所在的标签/页面,请添加颜色类别,然后使用JavaScript更新活动链接。</p>
<div class="w3-bar w3-black">
<button class="w3-bar-item w3-button tablink w3-red" onclick="openCity(event,'London')">伦敦</button>
<button class="w3-bar-item w3-button tablink" onclick="openCity(event,'Paris')">巴黎</button>
<button class="w3-bar-item w3-button tablink" onclick="openCity(event,'Tokyo')">东京</button>
</div>
<div id="London" class="w3-container w3-border city">
<h2>伦敦</h2>
<p>伦敦是英格兰的首都。</p>
</div>
<div id="Paris" class="w3-container w3-border city" style="display:none">
<h2>巴黎</h2>
<p>巴黎是法国的首都。</p>
</div>
<div id="Tokyo" class="w3-container w3-border city" style="display:none">
<h2>东京</h2>
<p>东京是日本的首都。</p>
</div>
</div>