Strong and b
Intro
In this lesson, we’re going to learn about a couple of inline elements. Inline elements are used to wrap around a word, phrase, sentence, or multiple sentences, usually within another element. To be more specific, we’re going to learn about the <strong>
and <b>
elements.
Both elements make text look bold by default. However, they serve different purposes. The <strong>
element is used to highlight text that is important or urgent. The <b>
element is used to highlight key terms in a block of text.
Steps
Add paragraph element
First, type p
at the end of your HTML file and press Tab to create a paragraph element. Then write This product is used to treat parasites.
in between the tags.
Add strong element
After the period, type a space, then strong
, and press Tab. This should create a pair of strong tags. In between the <strong>
tags, type Important: wash hands after using it!
.
Since this is a warning to the user, we wrapped the text in the <strong>
tags instead of the <b>
tags.
Add paragraph element
After the first <p>
element, type p
again and press Tab. Then write HTML code is made up of
in between the tags.
Add b element
Then type a b
and press Tab to create the <b>
tags. Then type the word elements
in between the tags.
Since the word elements is a key term in this sentence, we use <b>
tags instead of <strong>
tags.