时间:2021-07-01 10:21:17 帮助过:6人阅读
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>层固定位置练习--by 阿会楠</title>
<style type="text/css">
html,body{
overflow:hidden;
padding:0;
margin:0;
width:100%;
height:100%;
}
#_body{
height:100%;
overflow-y:scroll;
width:100%;
height:100%;
}
#adDiv{
position:absolute;
z-index:99999;
bottom:10px;
left:10px;
width:200px;
height:30px;
border:1px solid #8A9ABB;
background:#F0F4F7;
font:12px tahoma;
text-align:center;
line-height:30px;
}
</style>
</head>
<body>
<div id="adDiv"><a href="http://www.gxlcms.com/">脚本之家</a></div>
<div id="_body">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
</body>
</html>相关推荐:
vue监听滚动事件某元素吸顶或固定位置显示详解
CSS+DIV固定位置,不随滚动条而滚动_html/css_WEB-ITnose
随页面滚动显示/隐藏窗口固定位置元素_html/css_WEB-ITnose
如何在页面下固定位置显示数据库的值
以上就是如何使用css固定位置的详细内容,更多请关注Gxl网其它相关文章!