Introduction to CSS

What is CSS?

  • CSS stands for Cascading Style Sheets
  • Style defines how to display HTML elements
  • The style adds from HTML to solve the problem
  • External style sheets solve a lot of work
  • External style sheets are stored in CSS files

CSS saves a lot of work!

Style is normally saved in an external .css file, external style sheets enable you to change the appearance and layout of all pages of a website just by editing one single file.

CSS Syntax

  A CSS rule has two main parts: selector and declaration.

        text-align: center;
        color: #000;
        background-color: #ddd;

In the above example, p indicates selector, where text-align, color, and background color are declarations

The selector is normally the HTML element you want to style.

Each declaration consists of property and value.

The property is the style attribute you want to change each property has a value. 

A CSS declaration always ends with a semicolon and declaration groups are surrounded by curly brackets:

        background-color: #000;

Leave a comment
No Cmomments yet