Skip to main content

Before becoming a CSS master, it is very important to understand the CSS box model.

 CSS Box Model

CSSBoxModel

  1. Margin - Area outside the border
  2. Border - Area between the Margin and  Padding.
  3. Padding - Area between the border and  content.
  4. 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

  1. margin:  outer space 
  2. padding: inner space 
  3. border
  4. content