Thankfully, learning CSS is fairly simple. There’s really not a lot to the syntax which makes it easy to get up and running quickly.
CSS styles are made up of two parts:
- The selector
- The declaration
The selector, here ‘p‘ for paragraph, tells the browser which element or elements in the HTML document to style.
The declaration, which is enclosed in these curly brackets, uses the formatting instructions for the style. Here, there are two rules: one telling the browser which font to use and another defining the size of the font.
The rules themselves are made up of two parts: the property and the value. These are separated by colons and use a semicolon to tell the browser to stop evaluating and move on to the next rule.