What is the difference between content-box and border-box?

零下一度
Release: 2017-07-19 17:48:59
Original
3074 people have browsed it

What is the difference between What is the difference between content-box and What is the difference between content-box and border-box?? and What is the difference between content-box and border-box?? Let me explain it in detail below:

  • What is the difference between content-box and What is the difference between content-box and border-box??:

  • padding and border are not included in the definition Within width and height. The actual width of the object is equal to the sum of the set width value, border, and padding, that is (Element width = width + border + padding)

  • This property behaves like a box model in standard mode.

  • What is the difference between content-box and border-box?:

  • padding and border are included in the defined width and height. The actual width of the object is equal to the set width value. Even if border and padding are defined, the actual width of the object will not be changed, that is (Element width = width)

  • This attribute behaves weirdly Box model in mode.

Example:

  • What is the difference between content-box and What is the difference between content-box and border-box??:

    .test1{ box-sizing:content -box; width:200px; padding:10px; border:15px solid #eee; }

    What is the difference between content-box and What is the difference between content-box and border-box??

  • ##What is the difference between content-box and border-box?:

    .test2{ box-sizing:What is the difference between content-box and border-box?; width:200px; padding:10px; border:15px solid #eee; }

    What is the difference between content-box and border-box?

The above is the detailed content of What is the difference between content-box and border-box?. For more information, please follow other related articles on the PHP Chinese website!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!