Begin CSS

While starting with CSS, you should be aware of Selector as well as Declaration. The declaration includes property and values. Here’s an example to showcase the working of CSS, which adds a background color and font size and lets you know how to begin CSS learning,

Begin CSS Syntax

In the above figure, we saw the selector is the element (or tag) to be styled. The declaration contains background-color and font-size here, but it can include more declarations too separated by semicolons. Also, the declaration includes property and value, separated by colon, Here, our property is background-color and font-size with values blue and 12 respectively.

The declaration blocks as you can see above are surrounded by curly braces. Here, body is a selector. Now, we will see how to add comments to CSS,

Now, we will learn about different types of selectors in the next lesson.

CSS Overview
CSS Selectors
Studyopedia Editorial Staff
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading