CSS Inline Display: Bold

Kinda new to CSS and have what may be a silly question.

From a design perspective, should I be using HTML bold tags (ex: <b>bold statement here</b>) or using CSS for my inline markup?

Example …

HTML:
Let’s use HTML <b>BOLD</b> tag.

CSS:
Let’s use CSS to make <span class=“boldStmt”>BOLD</span> instead.

.boldStmt {
font-weight:bold;
}

Thanks!

I’d usen neither. You can use <em> to emphasize a word or phrase or <strong> to give an even stronger emphasis.

Via CSS you can then style your HTML elements accordingly.

Example:


em {
    font-weight:bold;
    font-style:normal;
    color:blue;
}

strong {
    font-weight:bold; /* not necessary as browsers have
                                  already set the default font-weight
                                  to bold. It's just for demonstration. */
    color:black;
}

Thanks!

Yes, you use CSS to style your HTML elements as you please.
If you have one general style for <strong> elements and one general style for <em> elements, then you don’t need to add a class or ID.

It is sufficient to just have this:


strong {color:black; /* or whatever styles you'd like to add */}

em {font-weight:bold; font-style:normal;}

Edit: Sorry, I didn’t see you deleted your second question. I’ll leave the response in anyway. :slight_smile:

If you want text to be bold use <b>, if you want to add emphasis to text use <em>, if you want to add strong emphasis use <strong>

Think of how a screen reader would interpret these tags and go from there. :slight_smile: