button bootstrap5 in html
To create a button in Bootstrap 5, you can use the following HTML code:
<button class="btn btn-primary">Click me</button>
This will create a primary-colored button with the text "Click me". You can customize the button's color and size by adding different Bootstrap classes to the button element. Here are some examples:
<button class="btn btn-success">Success</button> <!-- green button -->
<button class="btn btn-danger">Danger</button> <!-- red button -->
<button class="btn btn-warning">Warning</button> <!-- yellow button -->
<button class="btn btn-info">Info</button> <!-- blue button -->
<button class="btn btn-secondary">Secondary</button> <!-- gray button -->
<button class="btn btn-lg btn-primary">Large Button</button> <!-- large button -->
<button class="btn btn-sm btn-primary">Small Button</button> <!-- small button -->
You can also add icons to your buttons by using Bootstrap's built-in icon library, called "Bootstrap Icons". Here's an example:
<button class="btn btn-primary"><i class="bi bi-plus"></i> Add Item</button>
This will create a button with a plus icon and the text "Add Item". To use Bootstrap Icons, you'll need to include the Bootstrap Icons CSS file in your HTML code:
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel="stylesheet">
原文地址: https://www.cveoy.top/t/topic/uSc 著作权归作者所有。请勿转载和采集!