CSC336-WT Lec5 Slides
CSC336-WT Lec5 Slides
<!DOCTYPE html>
HTML5 IS THE LATEST VERSION OF IT PROVIDES NEW ELEMENTS, FOCUSES ON BETTER SEMANTICS,
THE HTML STANDARD. ATTRIBUTES, AND BEHAVIORS FOR MULTIMEDIA SUPPORT, AND
MODERN WEB DEVELOPMENT. DEVICE INDEPENDENCE.
Key Features of HTML5
1. Responsive Design:
o websites automatically adjust their layout and content based on the screen size
2. Viewport Meta Tag:
o It ensures that websites scale correctly on different screens.
3. Flexible Multimedia:
o HTML5 supports native multimedia (video and audio) without requiring third-party plugins (like Flash)
4. Cross-Platform Compatibility:
o HTML5 offers features such as the <canvas> element, which allows developers to build interactive and
graphical content that works across multiple devices without requiring additional software.
5. Forms and Input Types:
o HTML5 introduces new input types (like email, tel, date, etc.) that automatically adjust for different devices.
For example, a tel input type would bring up a numeric keypad on a smartphone
6. Offline Support:
o HTML5 includes technologies like localStorage and service workers that enable offline capabilities,
allowing web apps to continue working even without an internet connection, irrespective of the device.
HTML5 vs Previous Versions
HTML5: Introduced
HTML4: Focused
new tags with
more on formatting
semantic meaning to
with elements like
improve readability
<div> and <span>.
and accessibility.
The Importance of Semantic HTML
Semantic HTML improves accessibility, SEO, Helps browsers and search engines
and maintainability. understand the structure and content of a
webpage.
Semantic Elements Overview
• Represents a self-contained
composition in a document, like a blog
post or news article.
• Example:
<article>
<h2>Latest News</h2>
<p>This is a news article.</p>
</article>
The <section>
Element
<section>
<h2>About Us</h2>
<p>Details about the company...</p>
</section>
The <nav> Element
• Represents navigation links to other parts of the
website or external sites.
• Typically used for primary navigation menus.
• Example:
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
</ul>
</nav>
The <aside>
Element
HTML5 introduces native support for Elements: <audio> and <video>. Example (video):
audio and video without plugins.
<video controls>
<source src="video.mp4" type="video/mp4">
</video>
The <canvas> Element
HTML5 introduces new input types for Examples: email, url, date, range, Example:
better form validation. number, etc.
<input type="email" placeholder="Enter your email">
HTML5 Storage Options
localStorage: Stores data with no expiration
date.