What is Bootstrap?

后端 未结 9 984
南旧
南旧 2020-11-30 16:08

There are a lot of questions here related to Bootstrap. I see a lot of people using it. So I tried to research it, and I found the official Bootstrap site, but there was onl

9条回答
  •  佛祖请我去吃肉
    2020-11-30 16:36

    Disclaimer: I have used bootstrap in the past, but I never really appreciated what it actually is before, this description comes from me coming to my own definition, today. And I know that bootstrap v4 is out, but I found the bootstrap v3 documentation to be much clearer, so I used that. The library is not going to fundamentally change what it provides.

    Briefly

    Bootstrap is a collection of CSS and javascript files that provides some nice-looking default styling for standard html elements, and a few common web content objects that are not standard html elements.

    To make an analogy, it's kind of like applying a theme in powerpoint, but for your website: it makes things look pretty nice without too much initial effort.

    What does it consist of?

    The official v3 documentation breaks it up into three sections:

    • CSS
    • Components
    • Javascript

    These roughly correspond to the three main things that Bootstrap provides:

    • Plain CSS files that style standard html elements. So, Bootstrap makes your standard elements pretty-looking. e.g. html: Click me
    • CSS files that use styling on standard html elements to make them into something that is not a standard html element but is a standard Bootstrap element (e.g. https://getbootstrap.com/docs/3.3/components/#progress). In this way Bootstrap extends the list of "standard" web elements in a visually consistent way. e.g. html:
    • The CSS classes are designed with jQuery in mind. Internally, Bootstrap uses jQuery selectors to modify the styles on the fly and interact with the DOM, and thus provides the user the same capability. I believe this requires more explanation, so...

    Using Javascript/jQuery

    Bootstrap extends jQuery quite a bit. If we look at the source code, we can see that it uses jQuery to do things like: set up listeners for keydown event to interact with dropdowns. It does all of this jQuery setup when you import it in your

提交回复
热议问题