Home  >  Article  >  Web Front-end  >  div css box model_html/css_WEB-ITnose

div css box model_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:27:341449browse

So why is it called a box? Let’s first talk about the attribute names we often hear in web design: content, padding, border, and margin. CSS box mode all has these attributes.

We can imagine it as a box with an opening at the top in reality, and then looking down from the top, the border is equivalent to the thickness of the box, and the content is relative to the space of the object contained in the box , and the filling is equivalent to the foam filled in the box for shockproof, and the boundary is equivalent to leaving a certain space around the box for easy removal. Is it easy to understand the box model in this way?

So the width of the entire box model on the page is composed of the left border, left border, left padding, right padding, right padding, right border, and right border, and the width defined by width in the css style is only the width of the content part. This is where many friends easily get confused

The boundaries here are also called: outer margins and outer patches; padding is also called: inner margins and inner patches

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