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.

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. Setting display: block on WooCommerce’s .form-row elements stacks them again.
  • WooCommerce uses .col2-set with .col-1 and .col-2 for 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-1 and .col-2 are grid columns with a small max-width. max-width: unset removes 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.

Share on X (opens in a new tab) Share on LinkedIn (opens in a new tab) Share on Facebook (opens in a new tab)

ChatGPT (opens in a new tab) Claude (opens in a new tab) Gemini (opens in a new tab) Perplexity (opens in a new tab) Grok (opens in a new tab)

More Insights

See More