strong
Important text. Browsers usually render it bold, but the meaning is importance.
Learn HTML Formatting as a practical HTML text lesson with syntax, examples, common mistakes, accessibility notes and a live code lab.
HTML text basics
HTML has inline elements for important words, emphasized words, code, keyboard input, abbreviations and highlighted text. These elements do more than change how text looks.
The important distinction is meaning versus style. Strong means important. Em means emphasized. Code means code. CSS can make any of them look however you want.
Older elements such as b and i still exist, but they should be used carefully. If the text has real importance or emphasis, choose strong or em instead.
Important text. Browsers usually render it bold, but the meaning is importance.
Emphasized text. Browsers usually render it italic, but the meaning is stress emphasis.
Highlighted text that is relevant in the current context.
A short piece of computer code inside normal text.
Keyboard input, such as Ctrl + S or Command + K.
An abbreviation with an optional title explaining the full phrase.
Syntax and meaning
Formatting elements are normally used inside paragraphs, list items, table cells, buttons or other text content.
<p> Press <kbd>Command</kbd> + <kbd>S</kbd> to save. Use <code><strong></code> for <strong>important</strong> words. The <abbr title="Document Object Model">DOM</abbr> is created by the browser. </p>
<p> Press <b>Command + S</b> to save. Use <i>random italic text</i> because it looks nice. <span class="bold">Important warning</span> </p>
Practical rules
These rules are the part that saves time in real projects. If the HTML meaning is clean, CSS, JavaScript, accessibility checks and search optimization become easier to reason about.
Do not use strong only because you want bold text.
Em changes the tone of a sentence, not just the appearance.
Inline code should be marked as code so it can be styled consistently.
Highlight only text that is relevant to the current task or search.
Use abbr with a title when the abbreviation may not be obvious.
If the only goal is color, size or weight, CSS is usually the right layer.
Production thinking
Text markup matters because browsers and assistive technology do not only see letters. They also read structure, emphasis, quotes, code and relationships between pieces of text.
Semantic inline elements can give assistive technology better context than anonymous spans with classes.
Build a small typography system for inline code, keyboard input, marks and abbreviations so lessons and articles stay consistent.
Formatting elements are not magic SEO buttons. They help when they clarify real content, not when every keyword is made bold.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.