Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

HTML concept: typography

HTML describes the meaning of text fragments, while typeface, size, weight, and spacing belong to CSS.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

semantic inline elements + CSS presentation

em marks stress that changes sentence meaning, while strong marks importance, seriousness, or urgency; they are not interchangeable italic and bold commands.

b, i, u, and mark have their own narrow meanings; use them for context, not appearance alone.

sub and sup serve notational conventions, not smaller text; br inserts a break belonging to the content, not spacing between paragraphs.

The example retains separate em, strong, sub, sup, and br nodes even though textContent joins their visible text.

Examples

<!doctype html>
<meta charset="utf-8">
<p id="statement">You <em>must</em> save. <strong>Warning</strong>: H<sub>2</sub>O, x<sup>2</sup>.<br>Next line.</p>
<output id="result"></output>
<script>
const statement = document.querySelector("#statement");
result.textContent = `em=${statement.querySelector("em").textContent}; strong=${statement.querySelector("strong").textContent}; sub=${statement.querySelector("sub").textContent}; sup=${statement.querySelector("sup").textContent}; breaks=${statement.querySelectorAll("br").length}; text=${statement.textContent}`;
</script>

Result

em=must; strong=Warning; sub=2; sup=2; breaks=1; text=You must save. Warning: H2O, x2.Next line.

The result verifies DOM structure; it does not test fonts, line layout, or assistive-technology pronunciation.

Sources