
HTML5 is the latest version of HTML used to create and structure web pages . It defines how content (text, images, videos, etc.) is displayed in a...
HTML5 is the latest version of HTML used to create and structure web pages. It defines how content (text, images, videos, etc.) is displayed in a browser.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My Web Page</title>
</head>
<body>
<h1>Hello World</h1>
<p>This is HTML5 page.</p>
</body>
</html>
<!DOCTYPE html> โ tells browser this is HTML5<html> โ root element<head> โ metadata (title, charset)<body> โ visible contentAn HTML element consists of:
<tag>Content</tag>
<h1> to <h6> โ headings<p> โ paragraph<a> โ hyperlink<img> โ image<ul>, <ol>, <li> โ listsThese give meaning to content:
<header> โ top section<footer> โ bottom section<article> โ independent content<section> โ page section<nav> โ navigation links<header>
<h1>Website Title</h1>
</header>
HTML5 supports audio and video without plugins.
<video controls>
<source src="video.mp4">
</video>
<audio controls>
<source src="audio.mp3">
</audio>
Used to draw graphics via JavaScript.
<canvas id="myCanvas"></canvas>
New input types:
emaildatenumberrange<input type="email" placeholder="Enter email">
Stores data in browser:
localStorage.setItem("name", "Ali");
Attributes provide extra information about elements.
<a href="https://example.com">Visit</a>
idclasssrchrefalt<ul>
<li>Item 1</li>
</ul>
<ol>
<li>Item 1</li>
</ol>
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Ali</td>
<td>20</td>
</tr>
</table>
<form>
Name: <input type="text"><br>
Email: <input type="email"><br>
<input type="submit">
</form>
๐ Draw this in exam:
+-------------------+
| Header |
+-------------------+
| Navigation Menu |
+-------------------+
| Section |
| (Article) |
+-------------------+
| Footer |
+-------------------+
โ Tags are usually paired (<p></p>)
โ Some tags are self-closing (<img>)
โ Use proper nesting
โ HTML is not case-sensitive
โ Always include <!DOCTYPE html>
<canvas>?<div> and <section>?HTML5 = Structure of web page
Uses tags & elements
New features:
Works with CSS + JavaScript
Open this section to view and download past papers
Click on Show Past Papers to load available exam papers.