Strong marks text as especially important, such as a safety warning. b draws attention without adding the same importance, such as a key term in a summary.
What You Need to Know
Both often appear bold by default, but their meanings are different. Choose based on the text's purpose before styling.
Example: See It in Action
This example keeps the idea small. Copy it carefully, then follow the explanation instead of guessing what the browser will do.
This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.
<p><strong>Warning:</strong> Keep this file private.</p>
<p>The <b>new</b> backpack comes in three colors.</p>
<p>Both look bold by default, but mean different things.</p>
Let’s Understand the Example
- Strong marks text as particularly important. It means more than simply making words bold.
- B draws attention without saying that the text has extra importance.
- A p groups a paragraph of related text. Start another paragraph for a new thought.
Look for the text “Warning:” in the page. If the visible result surprises you, inspect the rendered elements to see what the browser actually built.
What Should You See?
The page should include “Warning:”. If it looks different from what you expected, open developer tools and compare the source with the elements the browser created.
Try removing one piece of markup in a scratch copy, refresh the page, and compare the behavior. This is often the fastest way to understand what that piece contributes.
Try It Yourself
- Mark a genuine warning with strong and a product name with b.
- Save your changes, open or refresh the page, and compare the result with the original example.
- Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.
Common Beginner Mistakes
- Using strong only to make an ordinary heading look heavier.
- Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.
Key Takeaways
- Strong marks text as especially important, such as a safety warning. b draws attention without adding the same importance, such as a key term in a summary.
- Strong marks text as particularly important. It means more than simply making words bold.
- Both often appear bold by default, but their meanings are different. Choose based on the text's purpose before styling.