Text, Links & Navigation · 8 min read · Beginner
Text Basics, Block vs. Inline & Entities
Distinguish block and inline elements, use semantic text tags like strong, em, time, code, and kbd, and escape special characters with HTML entities.
What you'll learn
- Tell the difference between block-level and inline-level elements
- Use semantic inline tags: <strong>, <em>, <mark>, <time>, <code>, <kbd>, <abbr>
- Display reserved characters like <, >, and & safely with HTML entities
HTML offers rich inline elements that carry real meaning, far beyond just making text bold or italic.
Block vs. Inline Elements
- Block elements (
<p>,<h1>–<h6>,<div>,<blockquote>,<ul>) start on a new line and stretch to fill the available width. - Inline elements (
<span>,<a>,<strong>,<em>,<code>,<kbd>) flow naturally inside a line of text and only take up as much width as their content needs.
Semantic Inline Text Elements
| Element | Meaning | Example |
|---|---|---|
<strong> | Strong importance / urgency | <strong>Warning:</strong> Save first. |
<em> | Verbal stress / emphasis | I <em>really</em> mean it. |
<mark> | Highlighted search match or reference | Match: <mark>HTML</mark> |
<time> | Machine-readable date or time | <time datetime="2026-11-25">Nov 25</time> |
<code> | Inline code snippet | Use <code>display: grid</code> |
<kbd> | Keyboard shortcut | Press <kbd>Ctrl</kbd> + <kbd>K</kbd> |
<abbr> | Abbreviation with expansion | <abbr title="HyperText Markup Language">HTML</abbr> |
HTML Entities
Because <, >, and & have special meaning in HTML, use character entities when you want to display them literally:
<→<>→>&→&©→©
Fill-in-the-Blank Exercise
Semantic Inline Markup
Mark up a keyboard shortcut, a machine-readable date, and an escaped HTML tag.
<p>Press <>⌘K</kbd> to search.</p>
<p>Updated < datetime="2026-11-25">Nov 25, 2026</time>.</p>
<p>Use the main> landmark.</p>Try It Yourself
Rich Semantic Typography
Live Result
Check Your Understanding
Score: 0 / 1
1. How do you safely display the literal text <h1> inside an HTML paragraph?
Study Workspace
Finished this lesson?
Your progress is saved locally in your browser, no account needed.