Bootstrap 3 Classes Reference

Bootstrap 3 is a powerful front-end framework that offers a vast collection of predefined CSS and JavaScript classes. These classes simplify the process of creating responsive, mobile-first web designs.

In this guide, we’ll cover all the key Bootstrap classes organized by category, making it easier for you to quickly find what you need.

For more tutorials, check out TheCodingCollege.com, your go-to resource for learning Bootstrap.

1. Layout Classes

These classes are used to structure the layout of your webpage using Bootstrap’s grid system.

ClassDescription
.containerCreates a fixed-width container with responsive breakpoints.
.container-fluidCreates a full-width container that spans the entire width.
.rowDefines a row in the grid system.
.col-xs-*Grid columns for extra small devices.
.col-sm-*Grid columns for small devices.
.col-md-*Grid columns for medium devices.
.col-lg-*Grid columns for large devices.
.visible-*Makes an element visible on specific screen sizes.
.hidden-*Hides an element on specific screen sizes.

2. Typography Classes

Bootstrap offers several typography-related classes for styling text elements.

ClassDescription
.text-leftAligns text to the left.
.text-rightAligns text to the right.
.text-centerCenters text horizontally.
.text-justifyJustifies text.
.text-mutedStyles text with a muted (gray) color.
.text-primaryStyles text with the primary color.
.text-successStyles text with the success color (green).
.text-infoStyles text with the info color (blue).
.text-warningStyles text with the warning color (yellow).
.text-dangerStyles text with the danger color (red).
.leadStyles text as a lead paragraph.
.smallReduces font size for smaller text.

3. Table Classes

These classes help style tables in your Bootstrap projects.

ClassDescription
.tableApplies basic Bootstrap table styling.
.table-stripedAdds zebra-striping to rows.
.table-borderedAdds borders to the table and its cells.
.table-hoverAdds a hover effect to table rows.
.table-condensedMakes the table more compact by reducing cell padding.
.activeHighlights a table row or cell.
.successStyles a row or cell with a green background.
.infoStyles a row or cell with a blue background.
.warningStyles a row or cell with a yellow background.
.dangerStyles a row or cell with a red background.

4. Button Classes

Bootstrap buttons are styled using these classes.

ClassDescription
.btnBase class for buttons.
.btn-primaryStyles the button with the primary theme color.
.btn-successStyles the button with the success theme color.
.btn-infoStyles the button with the info theme color.
.btn-warningStyles the button with the warning theme color.
.btn-dangerStyles the button with the danger theme color.
.btn-linkStyles the button to look like a hyperlink.
.btn-lgMakes the button large.
.btn-smMakes the button small.
.btn-xsMakes the button extra small.
.btn-blockMakes the button span the full width of its parent.

5. Alert Classes

Alert classes help display contextual messages.

ClassDescription
.alertBase class for alerts.
.alert-successDisplays a green success alert.
.alert-infoDisplays a blue info alert.
.alert-warningDisplays a yellow warning alert.
.alert-dangerDisplays a red danger alert.
.alert-dismissableAdds a close button to dismiss the alert.

6. Form Classes

These classes help style forms and inputs.

ClassDescription
.form-groupGroups form elements together.
.form-controlStyles input elements (text, email, password, etc.).
.form-inlineDisplays form elements inline.
.form-horizontalStyles forms with horizontal labels and inputs.
.control-labelStyles labels in horizontal forms.
.input-lgMakes input elements large.
.input-smMakes input elements small.
.help-blockAdds a block of help text below an input.

7. Utility Classes

Utility classes provide quick styling options for spacing, colors, and visibility.

ClassDescription
.pull-leftFloats an element to the left.
.pull-rightFloats an element to the right.
.clearfixClears floats.
.center-blockCenters a block element horizontally.
.hiddenHides an element.
.showForces an element to be displayed.
.text-hideHides text visually but keeps it accessible to screen readers.

8. Image Classes

ClassDescription
.img-responsiveMakes images responsive.
.img-roundedStyles images with rounded corners.
.img-circleStyles images as circles.
.img-thumbnailAdds a border and padding to images.

Conclusion

Understanding and utilizing Bootstrap 3 classes effectively can save you significant development time while maintaining a clean and professional design. Bookmark this reference on TheCodingCollege.com for quick access during your projects.

Leave a Comment