Before becoming a CSS master, it is very important to understand the CSS box model.
CSS Box Model
- Margin - Area outside the border
- Border - Area between the Margin and Padding.
- Padding - Area between the border and content.
- Content - The content of the box, where given text appear
CSS works based on Tags.
CSS can be used in three ways(inline, internal and external)
Tag as a selector
Class as a selector
Id as a selector
Tags vs Elements vs Attributes in HTML
HTML Tags: Tags are the starting and ending parts of an HTML element. They begin with < symbol and end with > symbol. Whatever written inside < and > are called tags.
For CSS better understanding it is very important to understand the box model first.
CSS considered All HTML elements as boxes.
There are 4 thing inside box
- margin: outer space
- padding: inner space