<\/p>
Under the default (content-box) standard box model, the box is stretched by the padding and borders. <\/p>
div{ width:100px; height:100px; background:hsla(360,50%,30%,0.5); padding:10px; border:10px solid red; box-sizing:border-box;}<\/pre>
<\/p>Under the IE traditional box model (border-box), the box size remains unchanged. <\/p>
Although the parsing mode of the box model in versions below IE6 does not comply with the W3C standard specification, this method is not useless. It also has a good side: no matter if you modify the border or padding size of the element, it will It will not affect the total size of the element box and will not disrupt the overall layout of the page. Under standard browsers, according to the W3C specification for parsing the box model, once the border or padding of an element is modified, it will affect the box size of the element, and the box size of the element will have to be recalculated, thus affecting the entire The layout of the page. <\/p>
overflow-x and overflow-y<\/h2>
The overflow attribute is a feature in the CSS2.1 specification, and the overflow-x and overflow-y attributes were added in CSS3.
Overflow-x and overflow-y are mainly used to define the effect of horizontal or vertical content overflow. <\/p>overflow-x:visible | hidden | scroll | auto | no-display | no-contentoverflow-y:visible | hidden | scroll | auto | no-display | no-content<\/pre>visible: Default value. Content is not cropped and may appear outside the content box.
hidden: Crops content and does not provide scrolling mechanism.
scroll: Crop content and provide scrolling mechanism.
Auto: Provides a scrolling mechanism if the box overflows.
no-display: If the content does not fit into the content box, delete the entire box.
no-content: Hide the entire content if it does not fit into the content box. <\/p>div{ width:200px; white-space:nowrap; overflow-x:scroll;}<\/pre><\/p>
overflow-x:scorll, adds a scrolling mechanism to the x-axis. <\/p>
div{ width:100px; height:100px; overflow-y:scroll;}<\/pre><\/p>
overflow-y:scorll, adds a rolling mechanism to the y-axis. <\/p>
resize<\/h2>
Used to change the size of elements, the main purpose is to enhance the user experience. <\/p>
resize:none | both | horizontal | vertical | inherit<\/pre>None: The user cannot drag the element to change the size.
Both: The user can drag the element and modify the width and height of the element at the same time.
Horizontal: The user can drag the element and only modify the width of the element.
Vertical: The user can drag the element and only modify the height of the element.
Inherit: Inherit the resize attribute value of the parent element. <\/p><\/title>