Bootstrp css style
Introduction
In HTML, the class attribute is used to apply CSS styles and JavaScript behaviors to elements. Some commonly used classes inside for styling and layout purposes include:Bootstrap (CSS Framework)
- Alerts: '
alert alert-primary
', 'alert alert-secondary
'', 'alert alert-success
', 'alert alert-danger
', 'alert alert-warning
', 'alert alert-info
', 'alert alert-light
', 'alert alert-dark
'. - Grid System: '
container
',container-fluid
,row
,col
,col-*-*
(e.g.,col-md-6
) - Text: '
text-left
', 'text-center
', 'text-right
', 'text-justify
', 'text-muted
', 'text-primary
', 'text-success
', 'text-info
', 'text-warning
', 'text-danger
. - Backgrounds: '
bg-primary
', 'bg-secondary
', 'bg-success
', 'bg-danger
', 'bg-warning
', 'bg-info
', 'bg-light
',bg-dark
, 'bg-white
. - Utilities: '
d-block
', 'd-inline-block
', 'd-flex
', 'd-none
',m-*-*
(e.g., m-3, my-4), 'p-*-*
' (e.g., p-2, py-3) - Buttons: '
btn
', 'btn-primary
', 'btn-secondary
', 'btn-success
',btn-danger
, 'btn-warning
', 'btn-info
', 'btn-light
', 'btn-dark
', 'btn-link
. - Display: '
display-1
', 'display-2
', 'display-3
', 'display-4
.
Tailwind CSS (Utility-First CSS Framework)
- Spacing:
m-*
(e.g.,m-4
,mt-2
),p-*
(e.g.,p-6
,px-3
) - Flexbox:
flex
,inline-flex
,flex-row
,flex-col
,justify-center
,items-center
- Grid:
grid
,grid-cols-*
(e.g.,grid-cols-3
),gap-*
(e.g.,gap-4
) - Text:
text-left
,text-center
,text-right
,text-justify
,text-sm
,text-lg
,text-xl
- Colors:
bg-*
(e.g.,bg-blue-500
),text-*
(e.g.,text-red-600
) - Borders:
border
,border-*
(e.g.,border-gray-300
),rounded
,rounded-*
(e.g.,rounded-lg
) - Display:
block
,inline-block
,hidden
,inline
,flex
,table
,table-row
,table-cell
Custom Classes
You can also define custom classes in your CSS file and use them in the class attribute, such as:.custom-container
.header-title
.footer-links
.highlight
Examples:
- Alert:
This is an info alert—check it out!
- Grid System:
Column 1Column 2
- Text and Background:
Centered text with primary background
- Utilities:
Flex item 1Flex item 2Flex item 3
- Button:
Hello, World!
Learn More