SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
HTML 5
PRABHAKARAN V M,
Department of CSE,
KIT - Coimbatore
OVERVIEW
• Why use HTML5
• HTML5 Basic
• HTML5 Block Level Elements
• HTML5 Multimedia
• HTML5 Advance Tag
• HTML5 Graphics
Why use Html5
• Html5 is more power full and easier than Html4.
• It allows to play audio and video on browser
• Using Html5 you can draw shapes like circle, rectangle, triangle.
Which is not possible in Html previous version
• In Html5 direct you can use header and footer tag for define Header
and footer section
• Here <nav> tag are available for declare navigation.
• Html5 allow to run JavaScript code in background Using web workers.
• It provides local storage in place of cookies.
HTML5 Basic
HTML Tags
Html5 Tags Description
<header> Defines a header for a document
<footer> Defines a footer for a document
<article> Defines an article in your document
<aside> Defines content aside from the page content
<audio> Allow to play audio on browser.
<canvas> Used to draw Graphics on web.
<figure> Specifies self-contained content
<meter> Defines a scalar measurement within a known range
<nav> Defines navigation links
<section> Defines a section in a document
<source> Defines multiple media resources for media elements (audio and video)
<video> Defines a video or movie
HTML Tags
Html5 Tags Description
<progress> Represents the progress of a task
<mark> Defines marked/highlighted text
<details> Used to create an interactive widget that the user can open and close
<bdi>
Full form of BDI is Bi-Directional Isolation. This element is useful when embedding user-
generated content with an unknown directionality.
<summary> It specifies a visible heading for <detailed> element.
<wbr> Used for possible line bread
<time> Used for define date and time
<track> Used for defines text tracks for media elements (<video> and <audio>)
<source> Used for defines multiple media resources for media elements (<video> and <audio>)
<ruby> Used for defines a ruby annotation
<output> Used for represents the result of a calculation
Difference Between Html and Html5
Html Html5
Doctype declaration in Html is too longer
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
DOCTYPE declaration in Html5 is very simple "<!DOCTYPE html>
character encoding in Html is also longer
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
character encoding (charset) declaration is also very simple <meta
charset="UTF-8">
Audio and Video are not part of HTML4
Audio and Videos are integral part of HTML5 e.g. <audio> and <video>
tags.
Vector Graphics is possible with the help of technologies such as VML,
Silverlight, Flash etc
Vector graphics is integral part of HTML5 e.g. SVG and canvas
It is almost impossible to get true GeoLocation of user browsing any
website especially if it comes to mobile devices.
JS GeoLocation API in HTML5 helps identify location of user browsing
any website (provided user allows it)
Html5 use cookies. It provides local storage in place of cookies.
Not possible to draw shapes like circle, rectangle, triangle. Using Html5 you can draw shapes like circle, rectangle, triangle.
Does not allow JavaScript to run in browser. JS runs in same thread as
browser interface.
Allows JavaScript to run in background. This is possible due to JS Web
worker API in HTML5
Works with all old browsers Supported by all new browser.
Doctype in Html5
Syntax
<!doctype html>
Example of using Doctype
<!DOCTYPE>
<html>
<body>
<p>This is my first Html5 code.</p></body></html>
Result
This is my first Html code.
Html5 Comment
Syntax
<!-- Html comment -->
Example
<html>
<body>
<!-- Html page -->
<p>This is simple html page<p>
<p>Html is simple and easy to learn<p>
</body>
</html> Result
This is simple html page
Html is simple and easy to learn
Multiline Comment
Syntax
<!-- Html Multi Line Comment -->
Example
<html>
<body>
<!-- Html page
Start from here -->
<p>This is simple html page<p>
<p>Html is simple and easy to learn<p>
</body>
</html>
Result
This is simple html page
Html is simple and easy to learn
Save and Compile in HTML 5:
Save and Run Html5 code
• Html5 code are save with .html or .htm extension.
• For run Html5 code you need any web browser (chrome, firefox etc).
No others software are required for run Html code web browser are
enough.
Compile Html5 Code
• No need to compile manually Html5 code, When you open your code
in any web browser then Html code are interpreted by browser
interpreter.
HTML Block Level Elements
<Header> tag
<!DOCTYPE>
<html>
<style>
header
{
background:cyan;
height:200px;
}
</style>
<body>
<header>
<p>KIT- CSE</p>
<p>Internet Programming</p>
<p>Login</p>
</header>
</body> </html>
OUTPUT
<Footer> Tag
<!DOCTYPE>
<html>
<body>
<h1>Content Section</h1>
<p>This Paragraph in content section.</p>
<footer>
<p>Thanks for Visiting</p>
<p>Contact us: prabhakar15oct@gmail.com</p>
</footer>
</body>
</html>
Result:
Thanks for Visiting
Contact us: prabhakar15oct@gmail.com
nav tag
<!DOCTYPE>
<html>
<head>
<style>
nav
{
color:blue;
}
</style>
</head>
<body>
<nav>
<a href="#">Java</a>
<a href="#">php</a>
<a href="#">Html</a>
</nav>
</body>
</html>
OUTPUT
<main> tag
<!DOCTYPE>
<html>
<body>
<h3>Programming Language</h3>
<main>
<article>
<h3>Html</h3>
<p>Html is very simple to use and it is also easy
to learn.</p>
</article>
<article>
<h3>Java</h3>
<p>Java is an object oriented programming
language.</p>
</article>
<article>
<h3>JavaScript</h3>
<p>JavaScript is mainly used for client side
validation.</p>
</article>
</main>
</body>
</html>
OUTPUT
article tag
<!DOCTYPE>
<html>
<head>
<style>
article
{
background:cyan;
}
</style>
</head>
<body>
<article>
<p>Tim Berners-Lee is known as
father of Html. The first publicly
available description of HTML was a
document called "HTML Tags", first
described, on the Internet by
Berners-Lee in late 1991.</p>
</article>
</body>
</html> OUTPUT
figure tag
<!DOCTYPE>
<html>
<body>
<p><strong>National Animal</strong> </p>
<figure>
<img src="F:Internet ProgrammingHTML 5tiger-new-wallpapers.jpeg"
title="Tiger" alt="Save the nation">
</figure>
</body>
</html> OUTPUT
HTML5 Multimedia
Audio format
Video format
audio tag
• Html <audio> tag defines sound, such as music or other audio
streams.
• Now, there are three supported audio file formats for the <audio>
tag; those are given below;
• MP3
• Wav
• Ogg
<!DOCTYPE>
<html>
<body>
<audio controls>
<source src="E:Music cornerBGMBGM 1College Introduction
Bgm.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>
</body>
</html>
OUTPUT
Video Tag in HTML5
• <video>tag are used to add video on web page. Html5 added new tag
for add video files on web page, befor html5 it is achieve by using
<embed> tag
Attributes of meter
• mp4
• webM
• ogg
<!DOCTYPE html>
<html>
<body>
<video controls>
<source src="E:Video SongsVandhaai Ayya - Baahubali 2.mp4"
type="video/mp4">
</video>
</body>
</html>
OUTPUT
Attributes of Video Tag
Atrribute Description
controls Used to defines the video controls which is displayed with play/pause buttons.
height Used to set the height of the video player.
width Used to set the width of the video player.
poster Used to specifies the image which is displayed on the screen when the video is not played.
autoplay Used to specifies that the video will start playing as soon as it is ready.
loop Used to specifies that the video file will start over again, every time when it is completed.
muted Used to mute the video output.
preload Used to specifies the author view to upload video file when the page loads.
src Used to specifies the source URL of the video file.
Html5 plug-ins
• A plug-ins are mainly used to extend the functionality of the Html
browser.
• Using html you can add or show your Youtube video on web page.
• Steps to add video on web page.
• Upload video on youtube.
• get video id.
• Define an <iframe> element in your web page.
• Specify hight and width of iframe for display video.
HTML5 Advance Tag
Progress Tag in HTML5
• The <progress> tag is used to display the progress of a task.
• Using this tag you van create a progress bar on web page.
• The main purpose of this tag is to show file uploading progress.
Attributes Description
Value It is defined how much task has been completed.
Max It define how much task required.
Attributes of Progress Tag
<!doctype html>
<html>
<body>
<progress></progess>
</body>
</html>
OUTPUT
Example with value and max attribute
<!doctype html>
<html>
<body>
<p>Download progress:</p>
<progress value="40" max="100">
</progess>
</body>
</html>
OUTPUT
Set height and width of progress
<!doctype html>
<html>
<head>
<style>
progress{
height: 40px;
}
</style>
</head>
<body>
<p>Download progress:</p>
<progress> </progess>
</body>
</html>
OUTPUT
Meter Tag
• <meter>tag are used to measure data within given range. This is also
known as a gauge.
• Uses of meter tag
• Meter tag are use to measure disk usage, same like in you computer
show how much a particular drive (on hard disk) full with data.
Attributes of meter
Attributes value Description
form form_id
Specifies one or more forms the <meter> element belongs
to
low number Specifies the range that is considered to be a low value
high number Specifies the range that is considered to be a high value
max number Specifies the maximum value of the range
min number Specifies the minimum value of the range
optimum number Specifies what value is the optimal value for the gauge
value number Required. Specifies the current value of the gauge
<!DOCTYPE html>
<html>
<body>
<p>Display a gauge:</p>
<meter value="2" min="20" max="100">2 out of 10</meter><br>
<meter value="0.7">70%</meter>
</body>
</html>
OUTPUT
<details> tag
• Html <details> tag is used for specify the additional details about any
contents on web page that the user can view or hide.
<!DOCTYPE>
<html>
<body>
<details>
<h3>III CSE</h3>
<p>Very Good and Hyperactive students</p>
</details>
</body>
</html> OUTPUT
HTML5 Graphics
<canvas> tag
• Html5 introduce new tag <canvas> which is used to draw graphics on the web
page. It draw graphics on web by using JavaScript.
• canvas is only a container for graphics you must need to write a script to draw
graphics on web page.
<!DOCTYPE>
<html>
<body>
<canvas id="canvasid" width="200" height="100" style="border:3px solid #F00;">
</canvas>
</body>
</html> OUTPUT
<svg> tag
• Html5 introduce new tag <svg>, SVG stands for Scalable Vector
Graphics. It is used to define graphics for the Web. <svg> tag is
container for SVG graphics.
• SVG has several methods for drawing paths, boxes, circles, text, and
graphic images. It is mostly used for vector type diagrams like pie
charts, 2-Dimensional graphs in an X,Y coordinate system etc.
Draw circle using svg tag
• To draw a circle you need <circle> tag with cx, cy and r attributes.
<!DOCTYPE>
<html>
<body>
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="yellow" stroke-width="4" fill="red"
/>
</svg>
</body>
</html>
OUTPUT
Draw rectangle using svg tag
• To draw a rectangle you need <rect> tag with it's attributes.
<!DOCTYPE>
<html>
<body>
<svg width="200" height="100">
<rect width="200" height="100" stroke="yellow" stroke-width="4"
fill="red" />
</svg>
</body>
</html>
OUTPUT
Draw polygon using svg tag
• To draw a polygon you need <polygon> tag with points attribute of polygon
tag.
<!DOCTYPE>
<html>
<body>
<svg width="210" height="200">
<polygon points="100,10 40,198 190,78 10,78 160,198"
style="fill:blue;stroke:black;stroke-width:5;fill-rule:nonzero;" />
</svg>
</body>
</html> OUTPUT

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5
 
What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)
 
Origins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTMLOrigins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTML
 
05 RD PoSD Tutorial_xhtml_to_html5_2016
05 RD PoSD Tutorial_xhtml_to_html5_201605 RD PoSD Tutorial_xhtml_to_html5_2016
05 RD PoSD Tutorial_xhtml_to_html5_2016
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
Webdev CCI Tel U - Introduction to HTML 5.0
Webdev CCI Tel U - Introduction to HTML 5.0Webdev CCI Tel U - Introduction to HTML 5.0
Webdev CCI Tel U - Introduction to HTML 5.0
 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & Friends
 
Html 5
Html 5Html 5
Html 5
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - Ebook
 
HyperText Markup Language - HTML
HyperText Markup Language - HTMLHyperText Markup Language - HTML
HyperText Markup Language - HTML
 
Html5 css3
Html5 css3Html5 css3
Html5 css3
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5
 
Basics of HTML
Basics of HTMLBasics of HTML
Basics of HTML
 
Html css workshop, lesson 0, how browsers work
Html css workshop, lesson 0, how browsers workHtml css workshop, lesson 0, how browsers work
Html css workshop, lesson 0, how browsers work
 
HTML 5 Complete Reference
HTML 5 Complete ReferenceHTML 5 Complete Reference
HTML 5 Complete Reference
 
Kick start @ html5
Kick start @ html5Kick start @ html5
Kick start @ html5
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5
 
How the Web Works Using HTML
How the Web Works Using HTMLHow the Web Works Using HTML
How the Web Works Using HTML
 
HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.
 

Semelhante a Html 5

Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
madhavforu
 

Semelhante a Html 5 (20)

Basics of HTML5 for Phonegap
Basics of HTML5 for PhonegapBasics of HTML5 for Phonegap
Basics of HTML5 for Phonegap
 
Fundamentals of HTML5
Fundamentals of HTML5Fundamentals of HTML5
Fundamentals of HTML5
 
Html5
Html5Html5
Html5
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
 
Html5 tags
Html5 tagsHtml5 tags
Html5 tags
 
[In Control 2010] HTML5
[In Control 2010] HTML5[In Control 2010] HTML5
[In Control 2010] HTML5
 
Html.pptx
Html.pptxHtml.pptx
Html.pptx
 
Html5 shubelal
Html5 shubelalHtml5 shubelal
Html5 shubelal
 
HTML Basics by software development company india
HTML Basics by software development company indiaHTML Basics by software development company india
HTML Basics by software development company india
 
Looking into HTML5 + CSS3
Looking into HTML5 + CSS3Looking into HTML5 + CSS3
Looking into HTML5 + CSS3
 
HTML 5 Web Design
HTML 5 Web DesignHTML 5 Web Design
HTML 5 Web Design
 
HTML (Hyper Text Markup Language)
HTML (Hyper Text Markup Language)HTML (Hyper Text Markup Language)
HTML (Hyper Text Markup Language)
 
HTML.pptx
HTML.pptxHTML.pptx
HTML.pptx
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
HTML5 tags.ppt
HTML5 tags.pptHTML5 tags.ppt
HTML5 tags.ppt
 
gdsc-html-ppt.pptx
gdsc-html-ppt.pptxgdsc-html-ppt.pptx
gdsc-html-ppt.pptx
 
HTML5
HTML5HTML5
HTML5
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
 
INTRUDUCTION TO HTML 5
INTRUDUCTION TO HTML 5INTRUDUCTION TO HTML 5
INTRUDUCTION TO HTML 5
 
Html5
Html5Html5
Html5
 

Mais de Prabhakaran V M (8)

Strings in python
Strings in pythonStrings in python
Strings in python
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Algorithmic problem solving
Algorithmic problem solvingAlgorithmic problem solving
Algorithmic problem solving
 
Open mp directives
Open mp directivesOpen mp directives
Open mp directives
 
Xml schema
Xml schemaXml schema
Xml schema
 
Introduction to Multi-core Architectures
Introduction to Multi-core ArchitecturesIntroduction to Multi-core Architectures
Introduction to Multi-core Architectures
 
Java threads
Java threadsJava threads
Java threads
 
Applets
AppletsApplets
Applets
 

Último

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Último (20)

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 

Html 5

  • 1. HTML 5 PRABHAKARAN V M, Department of CSE, KIT - Coimbatore
  • 2. OVERVIEW • Why use HTML5 • HTML5 Basic • HTML5 Block Level Elements • HTML5 Multimedia • HTML5 Advance Tag • HTML5 Graphics
  • 3. Why use Html5 • Html5 is more power full and easier than Html4. • It allows to play audio and video on browser • Using Html5 you can draw shapes like circle, rectangle, triangle. Which is not possible in Html previous version • In Html5 direct you can use header and footer tag for define Header and footer section • Here <nav> tag are available for declare navigation. • Html5 allow to run JavaScript code in background Using web workers. • It provides local storage in place of cookies.
  • 5. HTML Tags Html5 Tags Description <header> Defines a header for a document <footer> Defines a footer for a document <article> Defines an article in your document <aside> Defines content aside from the page content <audio> Allow to play audio on browser. <canvas> Used to draw Graphics on web. <figure> Specifies self-contained content <meter> Defines a scalar measurement within a known range <nav> Defines navigation links <section> Defines a section in a document <source> Defines multiple media resources for media elements (audio and video) <video> Defines a video or movie
  • 6. HTML Tags Html5 Tags Description <progress> Represents the progress of a task <mark> Defines marked/highlighted text <details> Used to create an interactive widget that the user can open and close <bdi> Full form of BDI is Bi-Directional Isolation. This element is useful when embedding user- generated content with an unknown directionality. <summary> It specifies a visible heading for <detailed> element. <wbr> Used for possible line bread <time> Used for define date and time <track> Used for defines text tracks for media elements (<video> and <audio>) <source> Used for defines multiple media resources for media elements (<video> and <audio>) <ruby> Used for defines a ruby annotation <output> Used for represents the result of a calculation
  • 7. Difference Between Html and Html5 Html Html5 Doctype declaration in Html is too longer <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> DOCTYPE declaration in Html5 is very simple "<!DOCTYPE html> character encoding in Html is also longer <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> character encoding (charset) declaration is also very simple <meta charset="UTF-8"> Audio and Video are not part of HTML4 Audio and Videos are integral part of HTML5 e.g. <audio> and <video> tags. Vector Graphics is possible with the help of technologies such as VML, Silverlight, Flash etc Vector graphics is integral part of HTML5 e.g. SVG and canvas It is almost impossible to get true GeoLocation of user browsing any website especially if it comes to mobile devices. JS GeoLocation API in HTML5 helps identify location of user browsing any website (provided user allows it) Html5 use cookies. It provides local storage in place of cookies. Not possible to draw shapes like circle, rectangle, triangle. Using Html5 you can draw shapes like circle, rectangle, triangle. Does not allow JavaScript to run in browser. JS runs in same thread as browser interface. Allows JavaScript to run in background. This is possible due to JS Web worker API in HTML5 Works with all old browsers Supported by all new browser.
  • 8. Doctype in Html5 Syntax <!doctype html> Example of using Doctype <!DOCTYPE> <html> <body> <p>This is my first Html5 code.</p></body></html> Result This is my first Html code.
  • 9. Html5 Comment Syntax <!-- Html comment --> Example <html> <body> <!-- Html page --> <p>This is simple html page<p> <p>Html is simple and easy to learn<p> </body> </html> Result This is simple html page Html is simple and easy to learn
  • 10. Multiline Comment Syntax <!-- Html Multi Line Comment --> Example <html> <body> <!-- Html page Start from here --> <p>This is simple html page<p> <p>Html is simple and easy to learn<p> </body> </html> Result This is simple html page Html is simple and easy to learn
  • 11. Save and Compile in HTML 5: Save and Run Html5 code • Html5 code are save with .html or .htm extension. • For run Html5 code you need any web browser (chrome, firefox etc). No others software are required for run Html code web browser are enough. Compile Html5 Code • No need to compile manually Html5 code, When you open your code in any web browser then Html code are interpreted by browser interpreter.
  • 12. HTML Block Level Elements
  • 14. <Footer> Tag <!DOCTYPE> <html> <body> <h1>Content Section</h1> <p>This Paragraph in content section.</p> <footer> <p>Thanks for Visiting</p> <p>Contact us: prabhakar15oct@gmail.com</p> </footer> </body> </html> Result: Thanks for Visiting Contact us: prabhakar15oct@gmail.com
  • 16. <main> tag <!DOCTYPE> <html> <body> <h3>Programming Language</h3> <main> <article> <h3>Html</h3> <p>Html is very simple to use and it is also easy to learn.</p> </article> <article> <h3>Java</h3> <p>Java is an object oriented programming language.</p> </article> <article> <h3>JavaScript</h3> <p>JavaScript is mainly used for client side validation.</p> </article> </main> </body> </html> OUTPUT
  • 17. article tag <!DOCTYPE> <html> <head> <style> article { background:cyan; } </style> </head> <body> <article> <p>Tim Berners-Lee is known as father of Html. The first publicly available description of HTML was a document called "HTML Tags", first described, on the Internet by Berners-Lee in late 1991.</p> </article> </body> </html> OUTPUT
  • 18. figure tag <!DOCTYPE> <html> <body> <p><strong>National Animal</strong> </p> <figure> <img src="F:Internet ProgrammingHTML 5tiger-new-wallpapers.jpeg" title="Tiger" alt="Save the nation"> </figure> </body> </html> OUTPUT
  • 20. audio tag • Html <audio> tag defines sound, such as music or other audio streams. • Now, there are three supported audio file formats for the <audio> tag; those are given below; • MP3 • Wav • Ogg
  • 21. <!DOCTYPE> <html> <body> <audio controls> <source src="E:Music cornerBGMBGM 1College Introduction Bgm.mp3" type="audio/mpeg"> Your browser does not support the audio tag. </audio> </body> </html> OUTPUT
  • 22. Video Tag in HTML5 • <video>tag are used to add video on web page. Html5 added new tag for add video files on web page, befor html5 it is achieve by using <embed> tag Attributes of meter • mp4 • webM • ogg
  • 23. <!DOCTYPE html> <html> <body> <video controls> <source src="E:Video SongsVandhaai Ayya - Baahubali 2.mp4" type="video/mp4"> </video> </body> </html> OUTPUT
  • 24. Attributes of Video Tag Atrribute Description controls Used to defines the video controls which is displayed with play/pause buttons. height Used to set the height of the video player. width Used to set the width of the video player. poster Used to specifies the image which is displayed on the screen when the video is not played. autoplay Used to specifies that the video will start playing as soon as it is ready. loop Used to specifies that the video file will start over again, every time when it is completed. muted Used to mute the video output. preload Used to specifies the author view to upload video file when the page loads. src Used to specifies the source URL of the video file.
  • 25. Html5 plug-ins • A plug-ins are mainly used to extend the functionality of the Html browser. • Using html you can add or show your Youtube video on web page. • Steps to add video on web page. • Upload video on youtube. • get video id. • Define an <iframe> element in your web page. • Specify hight and width of iframe for display video.
  • 27. Progress Tag in HTML5 • The <progress> tag is used to display the progress of a task. • Using this tag you van create a progress bar on web page. • The main purpose of this tag is to show file uploading progress. Attributes Description Value It is defined how much task has been completed. Max It define how much task required. Attributes of Progress Tag
  • 29. Example with value and max attribute <!doctype html> <html> <body> <p>Download progress:</p> <progress value="40" max="100"> </progess> </body> </html> OUTPUT
  • 30. Set height and width of progress <!doctype html> <html> <head> <style> progress{ height: 40px; } </style> </head> <body> <p>Download progress:</p> <progress> </progess> </body> </html> OUTPUT
  • 31. Meter Tag • <meter>tag are used to measure data within given range. This is also known as a gauge. • Uses of meter tag • Meter tag are use to measure disk usage, same like in you computer show how much a particular drive (on hard disk) full with data.
  • 32. Attributes of meter Attributes value Description form form_id Specifies one or more forms the <meter> element belongs to low number Specifies the range that is considered to be a low value high number Specifies the range that is considered to be a high value max number Specifies the maximum value of the range min number Specifies the minimum value of the range optimum number Specifies what value is the optimal value for the gauge value number Required. Specifies the current value of the gauge
  • 33. <!DOCTYPE html> <html> <body> <p>Display a gauge:</p> <meter value="2" min="20" max="100">2 out of 10</meter><br> <meter value="0.7">70%</meter> </body> </html> OUTPUT
  • 34. <details> tag • Html <details> tag is used for specify the additional details about any contents on web page that the user can view or hide. <!DOCTYPE> <html> <body> <details> <h3>III CSE</h3> <p>Very Good and Hyperactive students</p> </details> </body> </html> OUTPUT
  • 36. <canvas> tag • Html5 introduce new tag <canvas> which is used to draw graphics on the web page. It draw graphics on web by using JavaScript. • canvas is only a container for graphics you must need to write a script to draw graphics on web page. <!DOCTYPE> <html> <body> <canvas id="canvasid" width="200" height="100" style="border:3px solid #F00;"> </canvas> </body> </html> OUTPUT
  • 37. <svg> tag • Html5 introduce new tag <svg>, SVG stands for Scalable Vector Graphics. It is used to define graphics for the Web. <svg> tag is container for SVG graphics. • SVG has several methods for drawing paths, boxes, circles, text, and graphic images. It is mostly used for vector type diagrams like pie charts, 2-Dimensional graphs in an X,Y coordinate system etc.
  • 38. Draw circle using svg tag • To draw a circle you need <circle> tag with cx, cy and r attributes. <!DOCTYPE> <html> <body> <svg width="100" height="100"> <circle cx="50" cy="50" r="40" stroke="yellow" stroke-width="4" fill="red" /> </svg> </body> </html> OUTPUT
  • 39. Draw rectangle using svg tag • To draw a rectangle you need <rect> tag with it's attributes. <!DOCTYPE> <html> <body> <svg width="200" height="100"> <rect width="200" height="100" stroke="yellow" stroke-width="4" fill="red" /> </svg> </body> </html> OUTPUT
  • 40. Draw polygon using svg tag • To draw a polygon you need <polygon> tag with points attribute of polygon tag. <!DOCTYPE> <html> <body> <svg width="210" height="200"> <polygon points="100,10 40,198 190,78 10,78 160,198" style="fill:blue;stroke:black;stroke-width:5;fill-rule:nonzero;" /> </svg> </body> </html> OUTPUT