Course Content
Introduction
Introduction to CSS course
0/1
CSS Syntax
0/1
CSS Selectors
0/1
CSS Unit of Measurements
CSS units are used to specify measurements for various properties such as length, width, margin, padding, font size, and more.
0/1
CSS Colors
CSS provides various ways to specify colors.
0/2
CSS Properties And Values
0/1
CSS Background
0/1
CSS Box Model
0/1
CSS Display
CSS display property is used to control how an element is displayed on the webpage.
0/3
Typography and Font Properties
0/1
CSS Display And Positioning
0/2
Responsive Design with CSS Media Queries
0/1
About Lesson

CSS Syntax

CSS (Cascading Style Sheets) has a simple syntax that consists of selectors and declarations.

Selectors are used to target specific HTML elements, while declarations are used to define the styles for those elements.

A declaration consists of a property and a value, separated by a colon.

Multiple declarations can be grouped together within curly braces, known as a declaration block.

Here’s an example of CSS syntax:

selector {
     property: value;
     property: value;
}

Let’s break this down:

Selector:

This is the HTML element that the styles will be applied to. For example, h1 will select all h1 headings on the page.

Property:

This is the specific style that you want to apply to the element. These properties are called attributes in html. For example, color will change the text color of the element.

Value:

This is the value for the property that you want to apply. For example, red will change the text color to red.