本篇文章主要介绍如何使用css固定位置,非常不错,可以方便提示用户等信息,有感兴趣的小伙伴了解一下。
代码如下:
<!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.jb51.net/">本站</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>相关推荐:
CSS+DIV固定位置,不随滚动条而滚动_html/css_WEB-ITnose
立即学习“前端免费学习笔记(深入)”;
随页面滚动显示/隐藏窗口固定位置元素_html/css_WEB-ITnose
以上就是如何使用css固定位置的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号