📜  bootstarp btn 颜色 - Html (1)

📅  最后修改于: 2023-12-03 14:39:33.139000             🧑  作者: Mango

Bootstrap Button Colors

Bootstrap is a popular front-end framework used to build responsive and mobile-first websites. Bootstrap provides various button styles that can be customized to fit your needs. In this article, we will focus on the different button colors available in Bootstrap.

Basic Button Colors

Bootstrap provides six basic button colors - primary, secondary, success, danger, warning, and info. These can be used for a variety of purposes such as indicating the main action on a page or providing status feedback.

Here's an example of how to use the primary button style:

<button class="btn btn-primary">Click Me!</button>

And here's how to use the other basic button colors:

<button class="btn btn-secondary">Click Me!</button>
<button class="btn btn-success">Click Me!</button>
<button class="btn btn-danger">Click Me!</button>
<button class="btn btn-warning">Click Me!</button>
<button class="btn btn-info">Click Me!</button>
Outline Button Colors

Bootstrap also provides outline button styles for each of the basic button colors. These buttons have a transparent background and border that matches the color of the button. This style can be used for less prominent buttons that still need to stand out.

Here's an example of how to use the primary outline button style:

<button class="btn btn-outline-primary">Click Me!</button>

And here's how to use the other outline button colors:

<button class="btn btn-outline-secondary">Click Me!</button>
<button class="btn btn-outline-success">Click Me!</button>
<button class="btn btn-outline-danger">Click Me!</button>
<button class="btn btn-outline-warning">Click Me!</button>
<button class="btn btn-outline-info">Click Me!</button>
Link Button Colors

Bootstrap also provides link button styles that can be used to create text-only buttons that look like links. These styles can be used for linking to other pages or sections within a page.

Here's an example of how to use the primary link button style:

<button class="btn btn-link btn-primary">Click Me!</button>

And here's how to use the other link button colors:

<button class="btn btn-link btn-secondary">Click Me!</button>
<button class="btn btn-link btn-success">Click Me!</button>
<button class="btn btn-link btn-danger">Click Me!</button>
<button class="btn btn-link btn-warning">Click Me!</button>
<button class="btn btn-link btn-info">Click Me!</button>
Conclusion

Bootstrap provides a variety of button styles and colors that can be customized to fit your needs. By combining these styles with other Bootstrap components, you can create modern and responsive websites with ease.