In the training school study for one months, the most recent is the CSS, accurate said that the teacher in class to speak CSS for 8 days, the speed of the lecture, it may be for me this kind of zero-based students, feeling learning very difficult, but in the process also learned a lot of knowledge, Here mainly introduces the selection of CSS in the weight of the problem, CSS selectors are divided into three categories 1. Element selector 2. class selector 3.id selector 4. Wildcard characters, here are the first three classes.
Element selectors: such as Table,input,button, for example, they represent a large class, called an element. Its weight is the smallest, equivalent to a gram of weight units in daily life. It is a general definition of a large class such as Table,input,button, so the weights are the smallest relative to the first three.
Class selector: classes, which generally define a category in a Div, whose weight is greater than the element selector less than the ID selector, which is equivalent to a pound in the weight unit of everyday life.
ID Selector: The highest weight, mainly a specific definition of a label, it is equivalent to a ton of weight units in daily life.
4. Wildcard: Global control with *{}, the weight is the smallest one.
Differentiate class selector and ID selector weights I personally have a method: for example, the class selector is equivalent to the name of the identity card, the ID selector is equivalent to the ID number.
We all know the name may be the same, but the identity card number is unique, unique, of course, the weight of the ID card number is greater than the weight of the name, so that can be classified and ID selector.
Rookie for the second time to publish a diary, write not a lot of understanding! will be updated weekly, thank you!