First of all, to get out of your first work, take the second as a encouragement for the future.
As a beginner of CSS, it's a bit of a headache to start touching a lot of selectors, especially when you see that the symbol in the style is not the first time to determine which selector it is. First list the currently learned selectors and format: 1, Tag Selector div{
backgound-color:^;
width:^;
height:^;
magin:^,^,^,^;
padding:^,^,^,^;
}
2, class selector. lei{
Ditto
}
3. ID selector #ID {
Ditto
}
4. Group Selector div,span{
Ditto
}
5. Descendant selector DIV (space) span{
Ditto
}
It is important to note that when using the attribute margin and padding, the border order bit is left lower right and the property values are written in clockwise order, the selectors have precedence, and the smaller the range the higher the priority. 3>4>5>2>1
How to use different selectors in CSS efficiently and quickly as a beginner