2-5、定位回到顶部
* {
margin: 0;
padding: 0;
}
html,body {
width: 100%;
height: 100%;
font-size: 14px;
}
header {
height: 35px;
background: #666;
}
header a {
line-height: 35px;
color: #fff;
text-decoration: none;
margin: 0 15px;
}
.container{
height:200%;
}
.backtop{
}
.backtop a{
height: 32px;
width:32px;
position:fixed;
bottom:0;
right:10px;
background:#000;
opacity:0.5;
color:#fff;
cursor:pointer;
text-decoration:none;
}
/*此处写代码*/
网页内容
两个问题,
1、锚点链接只针对a标签,可我想对此处的功能锚链接到头部,而不是头部的某个链接,怎么做
2、浮动或定位是不是可以将行内元素块状化,因为我直接设置宽和高有效果(backtop下的a),可此时a的父元素div的margin失效了,设置无效果, 这个div未浮动未定位,难道还想上继承?