Take the label you mentioned as an example: a{color:#000}.
Before 1, {} was the selector of the object. In the above example, your selector has selected all the A tags in html;
2. In the middle of {} is the attribute name and attribute value of the object. Each attribute name and its corresponding attribute value are marked with ":"and ";" Combine into a group for use in the middle of each two groups of attributes. Separate;
3. At present, the basic selector of css only supports four formats, one is the tag name (written directly without symbols), the other is the class name (preceded by the "."class name), the other is the id name (preceded by "#"), and the other is the state (pseudo-class, and the selector is followed by special characters such as ":").
4. There is also an extension selector for css, which is relatively advanced and you will meet it slowly.
Here is an example, I hope it will help you understand.
Example 1:
a { color:# f00; }
The above code means that all
Example 2:
If there is such an html code fragment,
& ltahref = "sfd.html"> A label.
& lta class = " test " href = " SDF . html " & gt。 The other is the A tag, which has a class attribute with a value of test.
& ltp class="test "> this is a p tag with a class attribute with a value of test.
I hope that the color of the ordinary A label is #f00, the labels of all class tests are #00f, and the labels of class tests are #0f0, so you should write it like this.
a { color:# f00; }
. Test {color:# 00f;; }
a . test { color:# 0f 0; }