🌐 IT Unit 2: Complete HTML Guide
Based on Pearson Edexcel Scheme of Work (Topic 7 & 11) + Exam Summary
1. Document Structure & Meta Data
Every HTML page must follow a specific structure. This is covered in Scheme of Work 7.1.1 - 7.1.3.
<!DOCTYPE html> as the very first line. Always declare lang="en" in the html tag for accessibility.
2. Syntax & Global Attributes
Understanding how to write clean code and use attributes correctly (SoW 7.1.4 & 7.1.5).
- Use lowercase for all element names (e.g.,
<body>not<BODY>). - Use double quotes for attribute values (e.g.,
href="link.html"). - Indent nested elements for readability.
- Self-closing tags (like
<img>) do not require a forward slash in HTML5, but it is acceptable.
These attributes can be used on almost any HTML element:
id: Unique identifier for one element (used for CSS/JS).class: Identifier for multiple elements (used for CSS).style: Used for inline CSS (not recommended for large projects).hidden: Hides the element from view (Boolean attribute).tabindex: Controls the order of tab navigation (0 = default, -1 = no tab stop).data-*: Stores custom data (e.g.,data-user-id="123").
3. Text Formatting & Semantic HTML
Semantic HTML describes the meaning of the content, not just how it looks. This is crucial for SEO and Accessibility (SoW Topic 11).
<h1>to<h6>: Headings. Only one<h1>per page.<p>: Paragraphs.<hr>: Thematic break (horizontal rule).<br>: Line break (self-closing).
<em>vs<i>: Both look italic.<em>adds emphasis (semantic),<i>is just stylistic.<strong>vs<b>: Both look bold.<strong>adds importance (semantic),<b>is just stylistic.
<blockquote>: Long quotation from another source.<q>: Short inline quotation.<cite>: Title of a work (e.g., book name).<abbr>: Abbreviation (usetitleattribute for full text).<dfn>: Defines a term.<address>: Contact information for the author/owner.<mark>: Highlights text (like a highlighter pen).<code>: Displays computer code.
Use these instead of generic <div> tags where possible:
<header>: Introductory content or nav links.<footer>: Footer information (copyright, contacts).<nav>: Navigation links.<main>: The dominant content of the body (only one per page).<article>: Self-contained content (e.g., blog post).<section>: Thematic grouping of content.<aside>: Content indirectly related to the main content (sidebar).<figure>&<figcaption>: Media content with a caption.<div>&<span>: Non-semantic containers (use for layout only).
4. Lists
SoW 7.2.4 covers three types of lists.
<li>).5. Links (Anchor Tags)
SoW 7.2.5. The <a> tag uses the href attribute.
- External:
<a href="https://google.com">Google</a> - Internal:
<a href="contact.html">Contact</a> - Email:
<a href="mailto:test@example.com">Email</a> - New Tab: Add
target="_blank". - Anchor Link: Link to a specific part of a page using ID.
- Step 1:
<h2 id="section1">Top</h2> - Step 2:
<a href="#section1">Jump to Top</a>
- Step 1:
6. Tables
SoW 7.3.2. Used for data, not layout.
colspan="2": Cell spans 2 columns.rowspan="2": Cell spans 2 rows.
7. Images, Audio, Video & Iframes
alt attribute is mandatory for accessibility. If the image is decorative, use alt="".Use the <source> element to provide multiple formats for compatibility.
Embeds another website (e.g., YouTube, Maps).
8. Forms (HTML Structure)
SoW 7.3.3. While validation is JavaScript, the structure is HTML.
<fieldset> to group related form elements and <legend> for the group title.9. Block vs Inline Elements
SoW 7.2.1 & 7.2.2. Understanding content models.
- Block-level: Starts on a new line, takes full width (e.g.,
<div>,<p>,<h1>,<table>). - Inline: Stays on the same line, takes only necessary width (e.g.,
<span>,<a>,<img>,<strong>).
📝 Past Paper Style Questions
<q> (Use <blockquote> for long quotations).<strong> indicates importance (semantic), while <b> is purely stylistic.<img src="pic.jpg">alt attribute. All images must have alt text for accessibility (WCAG).colspan="2"<fieldset> (with <legend> for the caption).<ol type="A" start="3"> <li>Item</li> </ol>. What letter does the list start with?Based on Pearson Edexcel International Advanced Level Information Technology Unit 2 Scheme of Work (Topic 7 & 11).
No comments:
Post a Comment