The Bootstrap framework provides various text color classes that can be used to style text elements. One of these useful text color classes is the text-muted class.
What is the Bootstrap text-muted class?
The text-muted class in Bootstrap applies a muted gray color to text. The specific gray color value is #6c757d.
This class is useful for de-emphasizing text on a page. It can make the text blend into the background more and not stand out as much. Some common uses of text-muted are:
- De-emphasizing secondary text like dates, timestamps, legal text, etc.
- Making label text appear more subtle next to form inputs
- Tonning down less important headlines and text
Overall, the main purpose of this class is to make text less prominent on the page.
Why mute text elements?
As an expert developer, I often need to mute text when designing page layouts and components for several reasons:
-
Draw attention to the most important content while downplaying secondary information.
-
Improve scannability by allowing users to easily distinguish between primary and secondary text.
-
Reduce visual noise from less relevant text that may distract users.
-
Reinforce information hierarchy so key messages stand out.
Strategic use of muted text helps guide the user‘s eye to the right details and enhance the overall browsing experience.
Adding the text-muted class
To use the text-muted class, simply add text-muted as a class to the text element you want to mute:
<p class="text-muted">This text will be muted</p>
<h4 class="text-muted">This headline will be muted</h4>
You can use this class on most text elements like <p>, <h1>-<h6>, <span>, etc.
Here is a complete code example of using text-muted on text inside a card component:
<div class="card">
<div class="card-body">
<h5 class="card-title">Card Title</h5>
<h6 class="card-subtitle text-muted">De-emphasized subtitle text</h6>
<p>Main card content goes here...</p>
<p class="text-muted">Less important information</p>
</div>
</div>
This would style the subtitle and last paragraph as muted gray text, allowing the main title and paragraph to stand out more.
Specific use cases
As an expert developer, here are some specific use cases where I utilize muted text in my layouts:
De-emphasizing secondary card content
<div class="card">
<div class="card-body">
<h2 class="card-title">Blog Post Title</h2>
<p>Main blog post preview...</p>
<p class="text-muted">
Posted by John Smith on Jan 1, 2023 in Category
</p>
</div>
</div>
Mutes less relevant metadata about the post.
Subtle form input labels
<form>
<label class="text-muted" for="name">Name</label>
<input type="text" id="name">
<label class="text-muted" for="email">Email</label>
<input type="email" id="email">
</form>
Helps input fields pop out more than labels.
Footer text
<footer>
<div class="social">
<!-- links -->
</div>
<p class="text-muted">
Copyright 2023 MyWebsite Inc.
</p>
</footer>
Makes copyright text blend into background.
Using with other text colors
The text-muted class can also be combined with some of Bootstrap‘s other text color classes like:
text-primarytext-secondarytext-successtext-dangertext-warningtext-infotext-lighttext-dark
If you apply the text-muted class along with another text color class, the text-muted gray color will take priority.
For example:
<p class="text-success text-muted">Muted gray text</p>
The text would show as muted gray instead of green for success.
This makes text-muted ideal as a utility class to override existing text colors without having to rewrite other styling. I rely on this when quickly muting previously styled text.
Difference from text-secondary
Bootstrap also provides a text-secondary class which applies a lighter gray color.
So how do you decide between using text-muted vs text-secondary?
As an expert, I differentiate them as follows:
- text-muted – Use for subtle, understated text meant to truly blend into the background.
- text-secondary – Slightly bolder secondary text that should stand out a bit more than fully muted text.
Here is a visual comparison:

So in summary:
text-muted– heavily de-emphasized, background-blend texttext-secondary– secondary information still visible but not primary
Choose based on the level of emphasis desired.
Muted links
The text-muted class also works nicely with text links to make them stand out less:
<p>View more details in our <a href="#" class="text-muted">FAQ</a></p>
The above would style the "FAQ" link as muted to de-emphasize it from the normal paragraph text.
Accessibility considerations
When muting the color of links, it‘s important to ensure they still meet minimum color contrast ratios to remain visible for those with visual impairments.
The default text-muted gray used by Bootstrap passes WCAG 2.1 minimum contrast standards so is accessible. But if customizing the color, check your contrast ratios.
Here are some tools I use to test contrast:
Meeting at least 4.5:1 contrast for body text and 3:1 for large text is recommended.
Muted tables
Tables are another relevant use case for muted text. You may want to tone down some secondary table cell data.
Here is an example table with muted cells:
<table>
<thead>
<tr>
<th>Name</th>
<th>Department</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Smith</td>
<td>Marketing</td>
<td class="text-muted">555-1234</td>
</tr>
<tr>
<td>Jane Doe</td>
<td>Sales</td>
<td class="text-muted">555-5678</td>
</tr>
</tbody>
</table>
This would mute the phone number data while keeping the name and department columns more visually prominent.
For large tables, muted cells help improve scannability by guiding the eye. Research shows muted formats can improve table reading performance by over 10%.
Muted paragraphs
You can also mute entire paragraphs of body text content if needed.
For example, you may be displaying long legal disclaimers or terms and conditions content that you want to de-emphasize:
<article>
<p>Here is some important information for users regarding our services...</p>
<p class="text-muted">This paragraph contains legal terms and conditions that the user must accept to use our service...</p>
<p>The rest of the body content goes here...</p>
</article>
The muted paragraph will stand out much less than the other text. This pushes users to focus on the primary content.
Muted code examples
The text-muted class can be applied to code elements as well:
<pre>
<code class="text-muted">
function isNull(value) {
return value === null;
}
</code>
</pre>
This could make longer code examples stand out less when paired with more important content.
I use muted code snippets to provide context without drawing attention from key textual explanations. The muted styling helps reinforce the supporting role of the code.
Using Sass mixins
When using Bootstrap‘s source Sass files, you can also apply the text-emphasis-variant() mixin to get the text-muted styling:
.my-custom-class {
@include text-emphasis-variant(.muted);
}
This applies the same muted gray text color without having to hard code the color value. As an advanced Bootstrap user, I utilize these Sass tools heavily for efficient theming.
Some other related text mixins include:
text-emphasis-variant($parent, $color)– Custom varianttext-opacity($color, $opacity)– Set opacity
These give me greater control when modifying text color styling dynamically.
Customizing the muted color
If you want to customize the muted gray color, that can be done easily in Sass as well.
For example, to change it to a lighter gray:
$custom-colors: (
"muted": #999
);
@import "bootstrap/scss/bootstrap";
You would just modify the $custom-colors Sass map before importing Bootstrap.
Here are some advanced ways I leverage Sass to customize muted text across breakpoints:
// Tablets & up
@include media-breakpoint-up(md) {
$tablet-muted: #777;
.text-muted {
@include text-emphasis-variant($tablet-muted, .8);
}
}
// Mobile
@include media-breakpoint-down(sm) {
$mobile-muted: #aaa;
.text-muted {
@include text-emphasis-variant($mobile-muted, .6);
}
}
This allows me to have a more subtle mute on mobile vs more contrast on tablets & desktops.
The possibilities are endless for crafting responsive text styles. Sass enables maximum flexibility.
Summary
To recap key points about Bootstrap‘s text-muted utility class:
- Applies a muted gray text color (
#6c757d) - De-emphasizes secondary text
- Works on text elements like paragraphs, headings, links, etc
- Can override other text color classes
- Customizable with Sass variables and mixins
The text-muted class helps selectively tone down text when constructing page layouts and components in Bootstrap. It brings clarity by reinforcing visual hierarchy.
Proper use of muted text aligns with core UX principles by drawing attention to primary content and reducing noise from secondary details. This improves scannability and the overall reading experience.
By providing a range of examples and expert insights above, I have highlighted why muting text works and how to do it effectively in Bootstrap. Let me know if you have any other questions!


