HTML5 Class Notes
Introduction to HTML5
HTML5 is the latest version of Hypertext Markup Language, used to create and design web pages.
It introduces new elements, attributes, and features for better web applications.
Key Features of HTML5
1. Simpler DOCTYPE Declaration: <!DOCTYPE html>
2. New Semantic Elements: <header>, <footer>, <article>, <section>, <nav>.
3. Multimedia Support: New tags like <audio> and <video>.
4. Graphics and Animation: Use of <canvas> and <svg> for rendering graphics.
5. Improved Form Elements: New input types like date, email, range, etc.
6. Offline Capabilities: Offline access with the Application Cache and Web Storage.
Syntax Examples
1. Semantic Elements
<header>
<h1>Welcome to HTML5</h1>
</header>
<article>
<h2>About HTML5</h2>
<p>HTML5 is the standard for creating modern websites.</p>
</article>
<footer>
<p>© 2024 WebTech</p>
</footer>
2. Embedding a Video
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
3. Using the <canvas> Element
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #000000;"></canvas>
<script>
const canvas = [Link]('myCanvas');
const ctx = [Link]('2d');
[Link] = 'blue';
[Link](20, 20, 150, 75);
</script>