CSS Syntax
web development
Sunday, 21 March 2021
Hacker
web development
CSS Syntax
CSS syntax, In Web Documents A CSS rule consist's of a selector and a declaration block.
CSS Syntax
In CSS Syntax, The selector points to the HTML element which you want to apply CSS style.
In CSS syntax The declaration block contains single or more declarations, which is separated by semicolons.
Each declaration includes a Cascading Style Sheets property name and a value, separated by a colon.
Multiple CSS declaration blocks are surrounded by curly braces, and declarations are separated with semicolons.
Example CSS Syntax
In this example all <p> elements will be center aligned, with a green text color:
p {
color: green;
text-align: center;
}
color: green;
text-align: center;
}
Example Explained CSS Syntax
p
is a CSS selector (it points to the HTML element which you want to style: <p>).color
is a CSS property, and green is the property value.text-align
is a CSS property, andcenter
is the property value.
Note : We Can Discuss so more about CSS selectors and CSS properties in the CSS next chapters.
No comments:
Post a Comment