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

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

WBOY
Release: 2016-05-16 17:39:31
Original
1194 people have browsed it

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