How to Fix Bootstrap 4 CSS Issues on WooCommerce Pages & Forms

Quick Summary
- Fix misaligned WooCommerce form fields and squeezed billing and shipping columns under Bootstrap 4 with a few CSS overrides for shared class names.
- Set WooCommerce's form-row elements to display block, since Bootstrap 4 turns form-row into a flex row that places labels beside inputs.
- Unset max-width on the col-1 and col-2 columns inside col2-set, which Bootstrap treats as narrow grid columns, then clear any CSS optimization cache.
If your theme uses Bootstrap 4, the WooCommerce checkout forms and account forms can look broken: form fields don’t line up, and the billing and shipping columns shrink to a narrow strip. Both problems come from class names that WooCommerce and Bootstrap happen to share.
Add this CSS to your child theme’s style.css or to Appearance > Customize > Additional CSS.
.woocommerce-billing-fields .form-row,
.woocommerce-shipping-fields .form-row,
.woocommerce form .form-row {
display: block;
}
.woocommerce .col2-set .col-1,
.woocommerce-page .col2-set .col-1,
.woocommerce .col2-set .col-2,
.woocommerce-page .col2-set .col-2 {
max-width: unset;
}How it works
- WooCommerce wraps each form field in an element with the class
form-row. Bootstrap 4 uses the same class for a flexbox row, so a field’s label and input are laid out side by side as flex items. Settingdisplay: blockon WooCommerce’s.form-rowelements stacks them again. - WooCommerce uses
.col2-setwith.col-1and.col-2for two-column layouts, such as the billing and shipping details at checkout, the login and register forms in My Account, and saved addresses. In Bootstrap 4,.col-1and.col-2are grid columns with a smallmax-width.max-width: unsetremoves that limit, so WooCommerce’s own column widths apply.
The selectors are more specific than Bootstrap’s single-class rules, so they win even if Bootstrap’s stylesheet loads later. If you use a caching or CSS optimization plugin, clear its cache after adding the code.
A store theme built with WooCommerce in mind avoids clashes like this one; see my WooCommerce development services.
Related articles
- a two-column checkout form with CSS: the next layout step once the fields stack correctly
- extra fields on the registration form: new fields that use the same form-row classes
- cart thumbnails on mobile: another CSS fix for WooCommerce’s default styles
