Home >Web Front-end >HTML Tutorial >Please tell me how to float the div layer: for example, how to float the login dialog div layer up and down following the page_html/css_WEB-ITnose

Please tell me how to float the div layer: for example, how to float the login dialog div layer up and down following the page_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:09:241205browse

I am struggling to find a simple solution online. There is too much information online. Please give me a simple example. It can be implemented with css or jquery. Thank you very much


Reply to the discussion (solution)

If it is not position:fixed; it will move with the page

It is not position:fixed; They will all move with the page
1






< ;p>ss


ss


ss


ss



ss


ss


ss


ss< ;/p>

ss


ss


ss


ss

ss


ss


ss


ss


ss


ss


ss


ss


ss


ss


ss


ss


< ;p>ss


ss


ss


ss



ss


ss


ss


ss< ;/p>

ss


ss


ss


ss

ss


ss


ss


ss


ss


ss


ss


ss


ss


ss


ss


ss


< ;p>ss


Register

<script> <br> window.onscroll= window.onresize=function(e){ <br> var d = document.getElementById("y1"); <br> sTop = Math.max(document.body.scrollTop,document.documentElement.scrollTop) <br> d.style.top = sTop 200 "px" ; <br> d.style.left = (document.body.clientWidth-d.offsetWidth)/2 "px"; <br> } <br> </script>

position:fixed; is floating.

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