Home > Article > Web Front-end > What is the difference between content-box and border-box?
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.
.test1{ box-sizing:content -box; width:200px; padding:10px; border:15px solid #eee; }
.test2{ box-sizing:What is the difference between content-box and border-box?; width:200px; padding:10px; border:15px solid #eee; }
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!