Home  >  Article  >  Web Front-end  >  What is the difference between content-box and border-box?

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

零下一度
零下一度Original
2017-07-19 17:48:593089browse

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!

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