HTML Beginner
HyperText Markup Language — the structural skeleton and foundational blueprint of the web.
Table of Contents
Document Structure
Every HTML5 document requires a standard declarative skeleton so web browsers can parse and render layout parameters accurately.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Page Title</title> </head> <body> <!-- Visible page content goes here --> <h1>Hello, Web!</h1> </body> </html>
<head> contains metadata, styles, and configurations not visible to users, while the <body> contains everything rendered on screen.
Common Element Types
HTML utilizes specific tags to identify structural blocks. Modern code should favor semantic tags over generic structural wrappers.
Text Formatting
HTML provides hierarchical heading elements (<h1> to <h6>) and descriptive paragraphs to structure written copy semantically.
<h1>Main Heading (One per page)</h1> <h2>Sub-section Heading</h2> <p>This is a standard paragraph containing <strong>bold text</strong> for structural emphasis and <em>italicized text</em> for conversational stress.</p> <p>Use <code>console.log()</code> inline to show monospaced tech terms.</p>
Links & Attributes
Attributes provide configuration details inside the opening tag of an element. Anchors (<a>) require an href target attribute to construct hyperlinks.
<!-- Internal reference hyperlink --> <a href="about.html">Visit About Page</a> <!-- External target in a fresh sandbox tab --> <a href="https://github.com" target="_blank" rel="noopener">GitHub</a> <!-- Section jump link using unique ID selectors --> <a href="#s8">Jump to Forms Section</a>
Images & Void Elements
Some nodes are void elements (self-closing) and do not wrap text blocks. The <img> element uses src paths and requires an informative alt description.
<!-- Self-contained graphic reference asset --> <img src="assets/images/logo.png" alt="Corporate branding emblem"> <!-- Structural break lines --> <p>First line statement.<br>Forced newline break line inside paragraph.</p>
alt attribute. It is crucial for web accessibility (screen readers) and acts as fallback text if the image asset fails to load.
Lists
Organize sequential data items using ordered indexes (<ol>) or unordered bullet layouts (<ul>). Children must consist strictly of list item nodes (<li>).
<!-- Unordered Bullet List Layout --> <ul> <li>HTML5 Structure</li> <li>CSS3 Architecture</li> </ul> <!-- Ordered Numbered List Layout --> <ol> <li>Write Code Template</li> <li>Validate W3C Standard</li> </ol>
Tables
Tables manage multi-column tabular data matrices cleanly using a structural sequence of rows (<tr>), headers (<th>), and data cells (<td>).
<table> <thead> <tr> <th>Language</th> <th>Extension</th> </tr> </thead> <tbody> <tr> <td>HTML5</td> <td>.html</td> </tr> </tbody> </table>
Forms & Inputs
Forms parse and capture interactive user dataset inputs. Explicitly couple text labels to inputs using matching id and for attributes.
<form action="/submit-data" method="POST"> <!-- Linked Text Label and Input Element --> <label for="username">User Profile Name:</label> <input type="text" id="username" name="username" required> <!-- Password Variant Masking Mask --> <label for="pass">Security Access Key:</label> <input type="password" id="pass" name="password"> <!-- Action Confirmation Button Submit --> <button type="submit">Dispatch Payload</button> </form>