HTML•Typography
HTML Headings, Paragraphs, and Text Formatting Tags
Learn semantic text markup to ensure proper accessibility and search engine ranking.
Syntax
<h1>Main Heading</h1>
<p>Body paragraph with <strong>bold</strong> text.</p>
Parameters & Values
Key components and acceptable values for this structure:
| Parameter | Type | Description |
|---|---|---|
| <h1> to <h6> | Headings | Represents 6 levels of document section headings. |
| <p> | Paragraph | Blocks of body text with natural margin separation. |
| <code> | Inline Tag | Displays monospace programming code. |
Ready-to-Run Code Example
Executable in CompilraRun this complete, working example directly without installing HTML locally:
<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: sans-serif; line-height: 1.6; padding: 15px; }
code { background: #e2e8f0; padding: 2px 6px; border-radius: 4px; font-family: monospace; }
</style>
</head>
<body>
<h1>Chapter 1: Cloud Architecture</h1>
<h2>Section 1.1: Virtual Nodes</h2>
<p>To initialize a node, run the <code>compilra deploy</code> command in your terminal.</p>
<p><strong>Note:</strong> Always monitor memory usage with <em>top</em>.</p>
</body>
</html>Expected Output:
[Rendered Document Typography: H1, H2, Code Snippet, and Bold Emphasized Text]
How It Works: Step-by-Step
- Lines 9-10: Establishes clear heading hierarchy from <h1> to <h2>.
- Lines 11-12: Renders paragraphs with inline <code>, <strong>, and <em> elements.
Key Concepts
- Use only one <h1> per page for optimal SEO and screen-reader accessibility.
- <strong> conveys important semantic emphasis; <em> represents stress emphasis.
Common Mistake: Using multiple <h1> tags on a single page
Search engines and screen readers rely on a single primary <h1> to identify the page topic.
❌ Incorrect
<h1>First Title</h1> <h1>Second Title</h1>
✅ Correct
<h1>Primary Title</h1> <h2>Subtitle / Subsection</h2>
Related HTML Tutorials & Compiler
HTML5 Semantic Structural Boilerplate and Metadata Configurations
Structure HTML5 documents with semantic boilerplate tags (<!DOCTYPE html>, <meta>, <header>, <main>, <nav>, <footer>) and responsive viewport configurations.
HTML Links and Images: <a> href and <img> src Attributes
Create hyperlinks with <a href> and render responsive images using <img src alt>.
HTML Form Validation: Client-Side Input Requirement Attributes and Constraint Tags
Enforce client-side input validation and conditional submission guards using HTML5 constraint attributes (required, pattern, minlength, min/max).
HTML Online Compiler
Open in Compilra IDE
Run and test HTML on Compilra
Execute this code snippet with pre-supplied standard input (stdin) in Compilra’s cloud compiler.