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 Utilities in Bootstrap

Bs5 Utilities in Bootstrap

Sure! Here’s a quick guide to Bootstrap 5 Utilities — a powerful set of helper classes for spacing, sizing, positioning, colors, and more.


?? Bootstrap 5 Utilities

Bootstrap 5 includes many utility classes to rapidly style elements without writing custom CSS.


1. Spacing Utilities

Control margin and padding with shorthand:

  • Format: {property}{sides}-{breakpoint}-{size}

PropertyDescription
mmargin
ppadding
SidesAbbreviation
ttop
bbottom
sstart (left in LTR)
eend (right in LTR)
xleft and right
ytop and bottom
(blank)all sides
SizeValues
00
10.25rem (4px)
20.5rem (8px)
31rem (16px)
41.5rem (24px)
53rem (48px)
autoauto margin

Example:

<div class="mt-3 mb-2 px-4">Content with margin-top 1rem, margin-bottom 0.5rem, padding left/right 1.5rem</div>

2. Display Utilities

Control element display:

ClassDescription
.d-nonedisplay: none
.d-inlinedisplay: inline
.d-inline-blockdisplay: inline-block
.d-blockdisplay: block
.d-flexdisplay: flex
.d-inline-flexdisplay: inline-flex

Responsive variants: .d-{breakpoint}-{value} e.g. .d-md-none


3. Text Utilities

  • Text alignment: .text-start, .text-center, .text-end

  • Text wrapping: .text-wrap, .text-nowrap

  • Text truncation: .text-truncate

  • Text transform: .text-lowercase, .text-uppercase, .text-capitalize

  • Font weight: .fw-light, .fw-normal, .fw-bold

  • Font style: .fst-italic, .fst-normal

  • Text color: .text-primary, .text-secondary, .text-success, .text-danger, .text-warning, .text-info, .text-light, .text-dark, .text-muted, .text-white


4. Flex Utilities

ClassDescription
.d-flexdisplay flex
.d-inline-flexinline flex
.flex-rowflex direction row (default)
.flex-row-reversereverse row
.flex-columnflex direction column
.flex-column-reversereverse column
.flex-grow-1grow to fill space
.flex-shrink-1shrink
.flex-wrapallow wrapping
`.justify-content-startcenter
`.align-items-startcenter

5. Sizing Utilities

Control width and height:

ClassDescription
.w-25, .w-50, .w-75, .w-100width percentage
.w-autoauto width
.h-25, .h-50, .h-75, .h-100height percentage
.h-autoauto height
.mw-100max-width 100%
.mh-100max-height 100%

6. Position Utilities

ClassDescription
.position-staticstatic positioning
.position-relativerelative positioning
.position-absoluteabsolute positioning
.position-fixedfixed positioning
.position-stickysticky positioning
.top-0, .bottom-0, .start-0, .end-0position offsets

7. Overflow Utilities

ClassDescription
.overflow-autooverflow: auto
.overflow-hiddenoverflow: hidden
.overflow-visibleoverflow: visible
.overflow-scrolloverflow: scroll

8. Background and Border Utilities

  • Background colors: .bg-primary, .bg-success, .bg-danger, etc.

  • Borders: .border, .border-top, .border-end, .border-0 (remove borders)

  • Border colors: .border-primary, .border-success, etc.

  • Rounded corners: .rounded, .rounded-circle, .rounded-pill, .rounded-0


Summary

Bootstrap utilities let you quickly style components without writing custom CSS, speeding up development and keeping code clean.


If you want a deep dive on any particular utility or examples combining utilities, just let me know!

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