Home  >  Article  >  Web Front-end  >  About div adaptive height/left and right height adaptive consistent js code_javascript skills

About div adaptive height/left and right height adaptive consistent js code_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:39:311195browse

In using DIV and CSS for web page layout, the adaptive height and adaptive width of DIV is a very common problem.
In order to ensure the overall beauty of the page, the height/width of two or more layers needs to be consistent.

Left and right adaptive height consistent Jquery

Copy code The code is as follows:


1
3
5


< /div>



DIV height adaptive screen js
Copy code The code is as follows:

< ;/div>
dsafsafsafsafsafdsa

<script> <br>window.onload=function (){ <br>function auto_height() <br> { <br>//var h= document.documentElement.clientHeight-200; <br>//var high = document.getElementById("box"); <br>//high.style.height=h "px"; <br>document.getElementById("box").style.height=document.documentElement.clientHeight-200 "px"; <br>} <br>auto_height(); <br>onresize=auto_height; <br>} <br></script>
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