点击一个链接跳转新页面后显示的不是最顶部,而是某一块区域(比如:产品区域,)。
这怎么做?
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 关注
- 3297 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消
