Home >Web Front-end >JS Tutorial >Summary of 4 methods to make div floating layer, scroll bar move and keep position unchanged_javascript skills

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

WBOY
WBOYOriginal
2016-05-16 17:09:581295browse

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)




















Statement:
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