The value of the class attribute in the HTML element is separated by multiple spaces

Source: Internet
Author: User

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 . .alertis 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.