Home > Web Front-end > HTML Tutorial > Controlling the div to be fixed at a certain position on the page is very troublesome using js. CSS is better_html/css_WEB-ITnose

Controlling the div to be fixed at a certain position on the page is very troublesome using js. CSS is better_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-24 12:27:47
Original
992 people have browsed it

CSS代码:<style type="text/css">html,body {width:100%;height:100%;margin:0px;padding:0px;overflow:hidden;}#Main {position:absolute;bottom:0px;left:0px;width:100%;height:100%;overflow:auto;z-index:1;}#ToolBar {position:absolute;bottom:0px;right:16px;width:100%;height:20px;text-align:center;background:#ccc;z-index:2;overflow:hidden;}</style>HTML代码
Copy after login
<div id="ToolBar">CSS控制DIV永远固定在页面底部 www.865171.cn</div><div id="Main"><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p><p>www.865171.cn</p></div>
Copy after login

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template