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.
<p>This product is used to treat parasites.</p>
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!
.
<p>This product is used to treat parasites. <strong>Important: wash hands after using it!</strong></p>
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.
<p>This product is used to treat parasites. <strong>Important: wash hands after using it!</strong></p><p>HTML code is made up of </p>
Add b element
Then type a b
and press Tab to create the <b>
tags. Then type the word elements
in between the tags.
<p>HTML code is made up of <b>elements</b>.</p>
Since the word elements is a key term in this sentence, we use <b>
tags instead of <strong>
tags.
Final Code
<!-- <h1>Heading 1</h1><h2>Heading 2</h2><h3>Heading 3</h3><h4>Heading 4</h4><h5>Heading 5</h5><h6>Heading 6</h6> -->
<h1>Business Name</h1><h2>About</h2><p>Lorem ipsum dolor sit amet consectetur adipisicing elit. A, officia. Repudiandae fuga similique aspernatur porro distinctio quidem quis nihil reiciendis voluptatem quas quos eaque ad debitis officiis, iusto, adipisci animi?</p><h2>Contact</h2><h3>San Francisco Office</h3><p>Email us at sf@example.com.</p><h3>Los Angeles Office</h3><p>Email us at la@example.com.</p>
<p>This product is used to treat parasites. <strong>Important: wash hands after using it!</strong></p>
<p>HTML code is made up of <b>elements</b>.</p>