Inline elements mark up pieces of text within a paragraph — for emphasis, importance, code, quotes and more. Choosing semantic elements over purely visual ones keeps meaning intact.
Common inline elements
<em>emphasised</em> <!-- stress emphasis (usually italic) --><strong>important</strong> <!-- strong importance (usually bold) --><code>inline code</code><mark>highlighted</mark><a href="#">a link</a><br /> <!-- line break --><abbr title="HyperText Markup Language">HTML</abbr>
Semantic vs visual
Key takeaways
- 01Inline elements mark up text within a block: <em>, <strong>, <code>, <mark>, <a>.
- 02Prefer semantic <em>/<strong> (meaning) over visual <i>/<b> (appearance).
- 03Screen readers convey the meaning of semantic elements.
- 04Use CSS for pure appearance, not presentational tags.
