Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more: , +
i just touch this code and search alot on google to find out what does it do but didnt find suitable guide. what one thing i found its make my web responsive.
so what does all this do??
CSS
body{
width: 100%;
display: -webkit-box;/*new technology*/
-webkit-box-pack: center;
}
Posted

1 solution

Your CSS is used to center the child elements of a the body element by using the box-pack property

The webkit-box is used for Safari, Opera, and Chrome (other CSS for IE [-ms-flexbox], FF [-moz-box])

CSS
body{  
  /*...*/
  -webkit-box-pack:center;
  /*...*/

}  /* See below explanation */
Extra space is divided evenly, with half placed before the first child and the other half placed after the last child.

CSS
body{  
  /*...*/
  -webkit-box-align:center;
  /*...*/

}  /* See below explanation */
Any extra space is divided evenly, with half placed above the child and the other half placed below the child.


Cheers,
Edo
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900