Utility Class

noun

say it: “yoo-TIL-ih-tee klas” /juːˈtɪlɪti klæs/

A small CSS class that does exactly one thing, such as adding a margin or centering text.

What is Utility Class in CSS?

Utility Class — A small CSS class that does exactly one job, such as mt-4 (a top margin), text-center or fw-bold. You combine several on one element instead of writing new CSS for it.

<h2 class="mt-4 text-center fw-bold">Today's specials</h2>

In a sentence

  • “I centered the heading with the utility class text-center instead of writing new CSS.”

Level: Apprentice · More CSS terms at this level

Updated