📅  最后修改于: 2023-12-03 14:39:33.755000             🧑  作者: Mango
Bootstrap is a popular front-end development framework that provides a wide range of tools and components to create beautiful and responsive websites. One of the many components provided by Bootstrap is the hover effect, which can be applied to any HTML element.
In Bootstrap, hover effects are achieved by adding the .hover
class to a div
element, which triggers the effect when a user hovers over the element with their mouse. The .hover
class can be used in combination with other Bootstrap classes, such as .btn
, to create various hover effects on buttons.
<div class="btn btn-primary hover">
Hover me!
</div>
In this example, we have applied the .btn
class and .btn-primary
class to a div
element, which creates a blue button with white text. We have also added the .hover
class, which will trigger a hover effect when the user hovers over the button.
Bootstrap provides several hover classes that can be used to create different effects:
.hover
- basic hover effect on any element..hover-primary
- primary color hover effect on a button..hover-secondary
- secondary color hover effect on a button..hover-success
- success color hover effect on a button..hover-info
- info color hover effect on a button..hover-warning
- warning color hover effect on a button..hover-danger
- danger color hover effect on a button..hover-light
- light color hover effect on a button..hover-dark
- dark color hover effect on a button.Bootstrap provides a simple way to create hover effects on HTML elements using its .hover
class. With several hover classes available, developers can create unique and attractive hover effects on their websites.