Problem:
Like what
class="alert alert-info">
Reply:
At the same time to specify a number of CSS styles, the Alert-info can also be replaced with alert-warning,alert-success and so on, so separate multiple classes can reduce the repetition of the code , the alert style is only once written, Instead of repeating it in alert-warning,alert-info, this is done with a modular design that focuses on CSS . .alert
is the basic public layer, .alert-info
is a performance expansion layer. If we write separately, the small page is not a problem, but it is in a large project, it is very clumsy, increase the time cost of development. Therefore, in order to improve the reusability of the code, the similar structure or function and so on, the parts are zoned as a module. And then distill their generality, that is, before the code, and .alert
then separate their specific expression style, that is .alert-info
.
The value of the class attribute in the HTML element is separated by multiple spaces