Skip to the content.

What is CSS?

Return to Home

Definition

CSS(Cascading Style Sheets)- controls the styling of the document

Can be used for document text styling, create a layout, apply different effects, and more.

CSS Syntax

CSS is a rule-based language — you define the rules by specifying groups of styles that should be applied to particular elements or groups of elements on your web page.

CSS properties have different allowable values, depending on which property is being specified.

CSS modules

CSS is broken down into modules, such as background and borders. For example: background-color and border-color.

How to add CSS

Three ways to insert CSS

Cascading Order

All the styles in a page will “cascade” into a new “virtual” style sheet by the following rules, where number one has the highest priority:

  1. Inline style (inside an HTML element)
  2. External and internal style sheets (in the head section)
  3. Browser default

CSS color Property

The color property specifies the color of text.

color: {color|initial|inherit;}

Set the text color with a HEX value:

body {color: #92a8d1;}

Set the text color with an RGB value:

body {color: rgb(201, 76, 76);}