pythonian 23
pythonian 23

Reputation: 395

CSS different font for styles that make text bold

I am using a monospace font in my HTML project, and I don't like how the font looks when it's bold. However, I still need bold text for emphasis and headers, and because I also want the font to be different on all elements that use bold, like strong, h1, h2, etc. And any others that I add bold text in CSS. Is there a way to change the font, only for elements that have bold text?

Upvotes: 1

Views: 638

Answers (1)

tom
tom

Reputation: 10601

Common tags like b, strong and headings are styled by the browsers default stylesheet. You have to overwrite them by your own.

h1,
h2,
h3,
h4,
h5,
h6,
b,
strong {
    font-weight: normal;
}

Upvotes: 1

Related Questions