James Williams
Birmingham Newman University
jwilliams@staff.newman.ac.uk
3-hour session
<html>
<head>...</head>
<body>...</body>
</html>
See Moodle for supporting materials.
Learn the fundamentals of HTML in this beginner-friendly tutorial
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Page</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
See Moodle for supporting materials.
Learn about proper HTML document structure and semantic elements
The DOCTYPE tells the browser which version of HTML you're using.
<!DOCTYPE html>
<html lang="en">
... all content goes here ...
</html>
lang="en" specifies the language<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<title>Page Title</title>
</head>
<body>
<h1>Main Heading</h1>
<p>This is a paragraph.</p>
<img src="image.jpg" alt="Description">
</body>
<tagname>Content goes here</tagname>
<h1>Main Heading (largest)</h1>
<h2>Subheading</h2>
<h3>Sub-subheading</h3>
<h4>Level 4 heading</h4>
<h5>Level 5 heading</h5>
<h6>Level 6 heading (smallest)</h6>
<p>This is a paragraph of text. It can contain multiple sentences and will
be displayed as a block element with some spacing around it.</p>
<p>This is another paragraph. Each paragraph is separated from others with
some margin.</p>
<p>This is the first line.<br>This is the second
line.</p>
<hr>
<p>Content after the horizontal rule.</p>
<br> creates a line break<hr> creates a horizontal line<p>This is <strong>bold text</strong> and this is
<em>italic text</em>.</p>
<p>This is <mark>highlighted text</mark> and this is
<small>smaller text</small>.</p>
<p>This is <del>deleted text</del> and this is
<ins>inserted text</ins>.</p>
<ul>
<li>Unordered list item 1</li>
<li>Unordered list item 2</li>
</ul>
<ol>
<li>Ordered list item 1</li>
<li>Ordered list item 2</li>
</ol>
<a href="https://www.example.com">Visit Example.com</a>
<a href="page.html">Link to another page</a>
<a href="#section">Link to page section</a>
<a href="mailto:email@example.com">Send email</a>
href specifies the destination<img src="image.jpg" alt="Description of the image">
<img src="https://example.com/image.png" alt="External image">
<img src="photo.jpg" alt="Photo" width="300" height="200">
src specifies the image sourcealt provides alternative text (important for accessibility)
<header>Page header</header>
<nav>Navigation menu</nav>
<main>Main content</main>
<section>Content section</section>
<article>Article content</article>
<aside>Sidebar content</aside>
<footer>Page footer</footer>
<!-- This is a comment -->
<h1>My Page</h1>
<!-- Navigation section -->
<nav>...</nav>
<!-- TODO: Add more content here -->
my-first-page.htmlTime: 45 minutes
This task will help you understand basic HTML structure and elements
Take a break, ask questions, or catch up on the previous task.
Next: Secondary slides and Task 2
<!-- WRONG -->
<H1>Title</H1>
<p>Text<br>
<img src="image.jpg">
<!-- CORRECT -->
<h1>Title</h1>
<p>Text</p>
<img src="image.jpg" alt="Description">
Time: 45 minutes
This task will help you understand advanced HTML features and best practices
HTML Forms and Input - Working with user data