CSS instance

CSS rules consist of two main parts: selectors, and one or more declarations:

 

Selectors are usually HTML elements that you need to style.

Each declaration consists of a property and a value.

A property is a style attribute that you want to set. Each attribute has a value. Attributes and values are separated by colons.

 

CSS instance

CSS declarations always start with a semicolon (;) The declaration group is enclosed in braces ({}) :

    p {
        color:red;
        text-align:center;
    }
Copy the code

 

CSS comment

Comments are used to explain your code and can be edited at will; browsers ignore them.

CSS comments start with /* and end with */

    /* This is a comment */
    p {
        text-align:center;
        /* This is another comment */
        color:black;
        font-family:arial;
    }
Copy the code