CSS Tutorial
A declaration block and a selector make up a CSS rule.
The HTML element you wish to style is indicated by the selector.
One or more declarations are contained in the declaration block and are divided by semicolons.
A colon (:) separates the name of the CSS property from its value in each declaration.
Semicolons are used to divide CSS declarations, and curly braces are used to enclose declaration blocks.
In this example all <p> elements will be center-aligned, with a blue text color:
p {
color: red;
text-align: center;
}
CodingAsk.com is designed for learning and practice. Examples may be made simpler to aid understanding. Tutorials, references, and examples are regularly checked for mistakes, but we cannot guarantee complete accuracy. By using CodingAsk.com, you agree to our terms of use, cookie, and privacy policy.
Copyright 2010-2024 by Refsnes Data. All Rights Reserved.