HTML+CSS Easy Getting Started: What is a Selector?
The definition of css is composed of two parts
body{
Style
}
The part before {} is " Selector", "selector" specifies the object of the "style" in {}, that is, which elements in the web page the "style" acts on
body is an html element, so we also call it an element Selector
div table span etc.
Let’s look at the example below
元素选择器 中国
美国日本
Note: If there are many tags in the text and need to have the same style, then we will use css A lot of repeated code must be written in the style, so that the page will be untidy. Let's use a method to write it. The code is as follows:
元素选择器 中国
美国日本
The effect of writing this way is the same as the above, but the code will be very neat.