Home > Web Front-end > JS Tutorial > body text

Summary of 4 methods to make div floating layer, scroll bar move and keep position unchanged_javascript skills

WBOY
Release: 2016-05-16 17:09:58
Original
1234 people have browsed it

The div remains at the top and the scroll bar scrolls, but the div is still at the top! Upload the source code directly:

Method 1:

Copy the code The code is as follows:




div floating layer, scroll bar moves, Keep position unchanged




ddd

























< br>











< ;br>





















< br>


































<























< br>











< ;br>


















方法二:
复制代码 代码如下:


 
 

 


















 


















 


















 


















 


  居中的层



方法三:
复制代码 代码如下:


 
 

 居中的层
 



方法四:[采用css来居中]
复制代码 代码如下:







始终在中间DIV (支持IE FF)




















Related labels:
source:php.cn
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