What is CSS syntax ?
Hi everyone , In the previous post I had introduced you to CSS. Today I am going to be telling you about CSS syntax . So let's start .
What is CSS syntax ?
The CSS syntax consists of a selector and a declaration block .The CSS code is written inside the style tag and the style tag .
Selector
A selector is a part of the CSS line that selects what element to target with property/value pair .
For example: If you want to change the behavior of the h1 element (Let us say its font size should be 12px ), then you would use h1 as your selector .
Declaration
A property and its value collectively is known as Declaration . A declaration is generally that appears between the curly braces .
Property
It defines how different elements look on the web page . Font-family, color, background, border all are examples of properties . A property appears before the colon in any line of CSS .
Value
A value is what appears immediately after the colon in any line of CSS . It is the option chosen for the property .For example : The value for the Font-family property can be font names like Monotype Corsiva, Times , Arial etc .
That's it for this post . Thank you so much for reading this post . Please comment and share these posts .
Thank you
Comments
Post a Comment