Basics of CSS

Table of contents

What is CSS?

  • CSS stands for Cascading Style Sheets

  • CSS describes how HTML elements are to be displayed on the screen, on paper, or in other media.

  • CSS saves a lot of work. It can control the layout of multiple web pages all at once

  • External stylesheets are stored in CSS files

CSS Syntax

Selector: An HTML tag is a selector that uses a style. This might be a tag such as <h1> or <table> etc. The HTML element we like is indicated by the selector.

Property: An attribute type of an HTML tag is a property. All of the HTML attributes are simply converted into CSS. It might be color, border, etc.

Value: Properties are allocated values, such as a color property with either a red or #F1F1F1, etc. value.

The block of statements includes one or more statements separated by semicolons. Each statement includes the name and the value of the CSS property, separated by a colon. A CSS statement always finishes with a semi-colon, and blocks of the declaration are surrounded with curly braces.