Golang Tutorials - Learn Go Programming with Easy Step-by-Step Guides

Explore comprehensive Golang tutorials for beginners and advanced programmers. Learn Go programming with easy-to-follow, step-by-step guides, examples, and practical tips to master Go language quickly.

Bs5 Buttons in Bootstrap

Bs5 Buttons in Bootstrap

In Bootstrap 5 (BS5), buttons are core UI components used for actions and links. They're highly customizable using Bootstrap’s utility classes.


? Basic Button

<button type="button" class="btn btn-primary">Primary</button>
  • btn: Required base class

  • btn-primary: Contextual style (see options below)


? Contextual Button Classes

ClassDescription
btn-primaryMain action (blue)
btn-secondarySecondary action
btn-successPositive action
btn-dangerDestructive action
btn-warningCaution needed
btn-infoInformational
btn-lightLight background
btn-darkDark background
btn-linkStyled as a link

? Button Sizes

<button class="btn btn-primary btn-lg">Large</button><button class="btn btn-primary btn-sm">Small</button>
  • btn-lg: Large button

  • btn-sm: Small button


? Disabled Button

<button type="button" class="btn btn-secondary" disabled>Disabled</button>

Or for <a> tags:

<a class="btn btn-secondary disabled" tabindex="-1" aria-disabled="true">Disabled Link</a>

? Outline Buttons

<button class="btn btn-outline-success">Outline</button>

Outline buttons use border and text color instead of a solid background.


? Button as Link

<a href="#" class="btn btn-info">Link Button</a>

You can use buttons on <a>, <button>, or <input> elements.


? Block Level Buttons

Use utilities for full-width buttons:

<button class="btn btn-primary w-100">Block Button</button>

?? Active & Toggle Buttons

<button type="button" class="btn btn-primary active">Active</button>
<button type="button" class="btn btn-primary" data-bs-toggle="button">Toggle Button</button>

Use data-bs-toggle="button" for toggling behavior.


Would you like to see button groups, dropdown buttons, or buttons with icons next?

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql
postgresql
mariaDB
sql