How do I make text bold in HTML?
I'm trying to make some text bold using HTML, but I'm struggling to get it to work.
Here's what I'm trying:
Some <bold>text</bold> that I want emboldened.
Could someone tell me what I'm doing wrong?
Solution 1:
use <strong>
or <b>
tag
also, you can try with css <span style="font-weight:bold">text</span>
Solution 2:
HTML doesn't have a <bold>
tag, instead you would have to use <b>
. Note however, that using <b>
is discouraged in favor of CSS for a while now. You would be better off using CSS to achieve that.
The <strong>
tag is a semantic element for strong emphasis which defaults to bold.
Solution 3:
The Markup Way:
<strong>I'm Bold!</strong> and <b>I'm Bold Too!</b>
The Styling Way:
.bold {
font-weight:bold;
}
<span class="bold">I'm Bold!</span>
From: http://www.december.com/html/x1/
<b>
This element encloses text which should be rendered by the browser as boldface. Because the meaning of the B element defines the appearance of the content it encloses, this element is considered a "physical" markup element. As such, it doesn't convey the meaning of a semantic markup element such as strong.
<strong>
Description This element brackets text which should be strongly emphasized. Stronger than the em element.
Solution 4:
In Html use:
- Some
<b>
text</b>
that I want emboldened. - Some
<strong>
text</strong>
that I want emboldened.
In CSS use:
- Some
<span style="font-weight:bold">
text</span>
that I want emboldened.