Let’s look at the example directly and then explain the usage.
I am Donald Duck.
I live in Duckburg.
Note: For :before to work in IE8, a DOCTYPE must be declared.
The page effect is displayed as follows:
Let’s explain the use of the following css writing method
input[type="checkbox"] p:before{
content:"Lines:";
}
It only The two words "lines" will be added to the first paragraph with the label p immediately after the checkbox. There is a usage of and: before here, which is understood as the meaning of and, that is, input[type= "checkbox"] and the style will be added to the first p