JS and CSS

Source: Internet
Author: User

body{
height:100%;
Background-image:url (./img/background.png);
}

Body width Broken Screen size class set to height:100%;

#div1 {box-sizing:border-box; height:200px; width:200px; background:red; margin:10px; border:1px solid #000; padding : 20px;}
#div2 {box-sizing:content-box; height:200px; width:200px; background:red; margin:10px; border:1px solid #000; padding : 20px;}
</style>

<div id= "Div1" >border-box</div>
<div id= "Div2" >content-box</div>
<script>

Box-sizing:border-box;  is CSS3 new property, to understand this property, we start with the box size of the block-level element, usually a block-level element actually occupies a wide height = margin (margin) + boundary width (border-width) + padding (padding) + height (height)/ Widths (width)
If Border-box is set, the actual occupied width = Height set (height)/set width (width) + margin (margin)

The border and padding plenary in the width you set for the interior

-moz on behalf of the Firefox browser private properties
-ms for IE browser private properties
-webkit represents Chrome, safari private properties

function A () {
document.write (
"Screen resolution is:" +screen.width+ "*" +screen.height
+ "<br/>" +
"Screen Available size:" +screen.availwidth+ "*" +screen.availheight
+ "<br/>" +
"width of page visible area:" +document.body.clientwidth
+ "<br/>" +
"Page visible Area High:" +document.body.clientheight
+ "<br/>" +
"width of the visible area of the page (including the width of the edge):" +document.body.offsetwidth
+ "<br/>" +
"The visible area of the page is high (including the width of the edge):" +document.body.offsetheight
+ "<br/>" +
"Page body Full text width:" +document.body.scrollwidth
+ "<br/>" +
"Page body Full text High:" +document.body.scrollheight
+ "<br/>" +
"The page was rolled High:" +document.body.scrolltop
+ "<br/>" +
"The webpage was rolled away left:" +document.body.scrollleft
+ "<br/>" +
"On the body part of the webpage:" +window.screentop
+ "<br/>" +
"Page body part left:" +window.screenleft
+ "<br/>" +
"High screen resolution:" +window.screen.height
+ "<br/>" +
"Width of screen resolution:" +window.screen.width
+ "<br/>" +
"Screen usable workspace height:" +window.screen.availheight
+ "<br/>" +
Screen available work area width: +window.screen.availwidth
);
};

Let body height follow screen size

JS and CSS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.