Topic 1 - Introduction to HTML 5
Topic 1 - Introduction to HTML 5
What is hypertext?
What is markup language?
Roles of • Accessibility:
• improved user experience
HTML (1) • accessible to people with disabilities
• Structure:
• basic structure of a webpage
• defines headings, paragraphs, lists, and other content
blocks
HTML
• <header>: Represents the introductory content at the
top of a webpage, often containing logos and
navigation menus.
Documen •
•
<nav>: Represents a section containing navigation
links.
<main>: Encloses the main content of the webpage.
t •
•
<article>: Defines a self-contained piece of content,
like a blog post or article.
<section>: Represents a thematic grouping of
Structure •
content within an article or webpage.
<aside>: Represents content that is tangentially
related to the main content, such as sidebars or
widgets.
• <footer>: Contains footer information, typically found
at the bottom of the webpage.
Text-level
• These elements represent hierarchical
headings, ranging from the most important
<h1> to the least important <h6>.
Elements • Headings define the sections and sub-
sections of a webpage.
• Allows content organisation and improves
readability.
<body>
<p>Check out my <a href="https://www.example.com">website</a> for
more information.</p>
</body>
<body>
<p><abbr title="World Health Organization">WHO</abbr> provides health-
related information.</p>
</body>
<body>
<p>H<sub>2</sub>O is the chemical formula for
water.</p>
<p>2<sup>3</sup> = 8</p>
</body>
<body>
<p>This paragraph is separated by a
horizontal rule.</p>
<hr>
<p>Continuing with the next paragraph.</p>
</body>
<form action="/submit"
method="post">
<label
for="message">Message:</label>
<textarea id="message"
name="message" rows="4"
cols="50"></textarea>
<input type="submit"
IAL IT: Unit 2 Thusharika Thilakaratne 34
value="Submit">
HTML Forms
<select> and <option>:
• The <select> element creates a dropdown list, and <option> elements define the
individual options in the list.
• The name attribute is used to identify the select field when the form is submitted.
<form action="/submit" method="post">
<label for="country">Country:</label>
<select id="country" name="country">
<option value="USA">United
States</option>
<option value="UK">United
Kingdom</option>
<option value="Canada">Canada</option>
</select>
<input type="submit" value="Submit">
IAL IT: Unit 2</form> Thusharika Thilakaratne 35
HTML Forms
<button>:
• The <button> element represents a clickable button within the form.
• It can be used for various purposes, such as submitting the form, triggering
JavaScript functions, etc.
<form action="/submit"
method="post">
<button
type="submit">Submit</button>
</form>
Practices •
•
Some elements are self-closing (e.g., <br> and <img>)
Some require closing tags (e.g., <p></p>).
• Use Meaningful Text in Links and Buttons:
• Provide descriptive link text and button labels that are
meaningful.
2. Which HTML element is used to define the metadata of the document, such as its title and character set?
A) <body>
B) <header>
C) <meta>
D) <head>
3. Which HTML element is used to define a part of text in an alternate voice or mood?
A) <blockquote>
B) <cite>
C) <q>
D) <s>
2. Which attribute specifies the method the form data should be sent to the server?
A) method
B) action
C) type
D) enctype
3. What type of form input is used to submit the form to the server?
A) <input type="text">
B) <input type="submit">
C) <input type="button">
D) <input type="checkbox">