CSS - Basic Syntax

Basic Syntax

definition
DEFINITION:

Syntax simply means the arrangement of letters, figures, symbols and words in a particular sequence or order in which it can be properly interpreted by a language.

CSS syntax consist of the following

  • Selector - used to target the HTML element that you want to style.
  • Declaration - contains the property and the value of the style.
  • Property - style or behaviour.
  • Value - setting for the property.
syntax
tips
TIP:

Some property has two words which are separated with hyphen (-). For example, font-size, text-decoration, margin-left etc.

note
NOTE:

Property is also called Property Name
Value is also called Property Value


Case Sensitivity

CSS Property and Values are not case sensitive. That is: color is same as COLOR

CSS Tag Selectors are NOT case sensitive but CSS ID Selectors, Class Selectors, etc are case sensitive.

  • That is: h1 is same as H1
  • But #para1, .heading is NOT same as #PARA1, .HEADING
ADVERTISEMENTS

LEARNING IS A CONTINOUS PROCESS - PRACTICE MAKES PERFECT