CSS Syntax

CSS rule have 2 major part Selector & Declarations
Selector: Selector is basically nothing a HTML tag for e.g. p{color:#000;}. In this example P is the selector.

Other part of the CSS is Declaration, it the description of the property of the HTML tag that is selector for e.g. p{color:#000;}. In this Example color#000 is the deceleration, we are defining the color of the font.

Here are some example of CSS
CSS declarations always ends with a semicolon, and declaration groups are surrounded by curly brackets:
p{color:#FFFFFF; font-weight:bold;}

To make CSS more readable we can write as
p{
color:#ffffff;
font-weight:bold;
}

  • Share/Bookmark