<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> .content{ width: 200px; height: 200px; position: absolute; top: 50px; left: 10px; border: 1px solid #000; display: none; } a{ text-decoration: none; width: 80px; height: 30px; line-height: 30px; border: 1px solid #000; margin-left: -1px; padding: 0 10px; float: left; color: #000; text-align: center; } .content:target{ display: block; } .content:target+a{ background: #000; color: #fff; } </style> </head> <body> <div class="wrap"> <div id="div1" class="content">网站首页内容</div> <a href="#div1">网站首页</a> <div id="div2" class="content">公司简介内容</div> <a href="#div2">公司简介</a> <div id="div3" class="content">联系我们内容</div> <a href="#div3">联系我们</a> <div id="div4" class="content">下载客户端内容</div> <a href="#div4">下载客户端</a> </div> </body> </html>