But at this time the demand has increased. There must be not only a gray box on the page, but also a blue box, and maybe a green one. Usually we would say to use integration, so let’s make the following changes
But this time the needs have changed again. The roots are different from the applications. Some of the boxes need to be used. Size 12 fonts, some need to use size 14 fonts, some need to be 10px and some need 20px. It is estimated that your head will be big at this time. If you want to use inherited css code, it will become extremely complicated, then let's experiment Let's see if we can solve it through a combination of methods.
this a gray fontsize12px padding20px box
this a gray fontsize14px padding10px box
div>
….
Let’s look at some of them. Although a few are referenced on the class, the code and logic are very clear, and they are very easy to maintain. They can be combined and expanded at will. As you can see from the above, the method of "combination" is self-evident, but it is not perfect. When splitting the combination, be sure not to overdo it, otherwise the effect may be counterproductive. Only by using combination inheritance appropriately can our code More elegant and artistic.