<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style type="text/css">
a {
text-decoration:none;
}
:target {
background-color:red;
}
</style>
</head>
<body>
<p id="menu">
<a href="#text1">示例文字1</a>|
<a href="#text2">示例文字2</a>|
<a href="#text3">示例文字3</a>|
<a href="#text4">示例文字4</a>|
<a href="#text5">示例文字5</a>
</p>
<div id="text1">
<h2>示例文字1</h2>
<p>...此处略去</p>
</div>
<div id="text2">
<h2>示例文字2</h2>
<p>...此处略去</p>
</div>
<div id="text3">
<h2>示例文字3</h2>
<p>...此处略去</p>
</div>
<div id="text4">
<h2>示例文字4</h2>
<p>...此处略去</p>
</div>
<div id="text5">
<h2>示例文字5</h2>
<p>...此处略去</p>
</div>
</body>
</html>
效果如下: