点击一个链接跳转新页面后显示的不是最顶部,而是某一块区域(比如:产品区域,)。
这怎么做?
8 回答
業余奶茶品鑒師
TA貢獻260條經驗 獲得超388個贊
用錨鏈接,
錨鏈接一般用于本頁面的跳轉,比如頁面太長,到了尾部要瞬間到頂部,就可以用錨鏈接。
舉個例子:
<html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312"?/>
<style?type="text/css">
.d1{
border:1px?solid?red;
width:400px;
height:2000px;
}
.d2{
border:1px?solid?blue;
width:400px;
height:400px;
margin-top:1000px;
}
</style>
<title>錨鏈接的使用</title>
</head>
<div?class="d1">
<a?href="#mao1">點我跳轉mao1</a>
????<div?class="d2">
????<a?name="mao1">我是mao1</a>
????</div>
</div>
<body>
</body>
</html>- 8 回答
- 0 關注
- 3282 瀏覽
相關問題推薦
添加回答
舉報
0/150
提交
取消
