filmov
tv
The CSS Box Model Explained in 5 Minutes!
Показать описание
The CSS Box Model Explained in 5 Minutes!
The CSS Box Model is the most foundational and fundamental concept in all of CSS. Understanding it will allow you to create layouts in your webpage more easily and in a way that makes sense. Not understanding it will cause you to waste time you shouldn't need to laying out your elements and likely cause your CSS to be harder to understand.
In short, every element is rendered on a web page as a box. This box consists of four areas:
1. Content
This is where the content of the element lives. (Text, nested elements). Width and height properties apply to the content area by default.
2. Padding
This is the spacing between the content and the element's border. It can give breathing room to the content within your element.
3. Border
This is the (sometimes) visual divider around your element. It is still included as a part of your element.
4. Margin
This is the spacing around your element. It determines the distance between your elements and others around it. Watch out! There's an important "gotchya!" here... make sure you check the video to hear it!
The CSS Box Model is the most foundational and fundamental concept in all of CSS. Understanding it will allow you to create layouts in your webpage more easily and in a way that makes sense. Not understanding it will cause you to waste time you shouldn't need to laying out your elements and likely cause your CSS to be harder to understand.
In short, every element is rendered on a web page as a box. This box consists of four areas:
1. Content
This is where the content of the element lives. (Text, nested elements). Width and height properties apply to the content area by default.
2. Padding
This is the spacing between the content and the element's border. It can give breathing room to the content within your element.
3. Border
This is the (sometimes) visual divider around your element. It is still included as a part of your element.
4. Margin
This is the spacing around your element. It determines the distance between your elements and others around it. Watch out! There's an important "gotchya!" here... make sure you check the video to hear it!
Комментарии