SlideShare a Scribd company logo
What is HTML5 ?
●

Html5 is the latest technology of the HTML standard(originally
created in 1990).

●

Html5 is an improvement of HTML4.0 and XHTML1.0.

●

Work started in 2003 by W3C and WHATWG.

●

●

●

A change from document markup language to web application
language.
An attempt to enhance the functionality and flexibility of the web.
Html5 is language for structuring and presenting content for the
World Wide Web.
New in HTML5 Features:
●
●

●
●

●

The <canvas> element for 2D drawing
The <video> and <audio> elements for media
playback
Support for local storage
New content-specific elements, like <article>,
<footer>, <header>, <nav>, <section>
New form controls, like calendar, date, time,
email, url, search
HTML5 Canvas
●

●

●

●

●

A canvas is a rectangular area on an HTML page, and it is
specified with the <canvas> element.
The HTML5 <canvas> element is used to draw graphics, on the
fly, via scripting (usually JavaScript).
The <canvas> element is only a container for graphics. You
must use a script to actually draw the graphics.
Canvas has several methods for drawing paths, boxes, circles,
text, and adding images.
The markup looks like this:
<canvas id="myCanvas" width="200" height="100"></canvas>

Note: By default, the <canvas> element has no border and no
content.
Canvas Coordinates
●

The canvas is a two-dimensional grid.

●

The upper-left corner of the canvas has coordinate (0,0) .

●

Example: Suppose we have parameters of a rectangle
as(0,0,150,75):
This means: Start at the upper-left corner (0,0) and draw a
150x75 pixels rectangle.

●
●

●

Example:
Result
Canvas – Paths
(straight line)
●

To draw straight lines on a canvas, we will use the
following two methods:
- moveTo(x,y) defines the starting point of the line
- lineTo(x,y) defines the ending point of the line

●

To actually draw the line, we must use one of the "ink"
methods, like stroke().
Canvas – Paths
(straight line)
●

Example:
at (200,200).

Draw a straight line starting from (0,0) and ending
Canvas – Paths
(straight line)
●

Output:
Canvas – Paths
(circle)
●

To draw a circle on a canvas, we will use the following
method:
- arc(x,y,r,start,stop)

●

To actually draw the circle, we must use one of the "ink"
methods, like stroke() or fill().
Canvas – Paths
(circle)
●

Example: To create a circle with the arc method.
Canvas – Paths
(circle)

●

Output:
Canvas - Text
●

To draw text on a canvas, the most important property and
methods are:
- font - defines the font properties for text
- fillText(text,x,y) - Draws "filled" text on the canvas
- strokeText(text,x,y) - Draws text on the canvas (no fill)
Canvas - Text
●

Example: Using filltext():
Canvas - Text
●

Output:
What is SVG?
●

SVG stands for Scalable Vector Graphics

●

SVG is used to define vector-based graphics for the Web

●

SVG defines the graphics in XML format

●

SVG graphics do NOT lose any quality if they are zoomed or re
sized

●

Every element and every attribute in SVG files can be animated

●

SVG is a W3C recommendation
SVG Advantages
●

Advantages of using SVG over other image formats (like
JPEG and GIF) are:

-These can be created and edited with any text editor
- Can be searched, indexed, scripted, and compressed
- Are scalable
- Can be printed with high quality at any resolution
- Are zoom able
Comparison of Canvas and SVG
SVG Shape Elements
●

SVG has some predefined shape elements that can be used by
developers:
- Rectangle <rect>
- Circle <circle>
- Ellipse <ellipse>
- Line <line>
- Polyline <polyline>
- Polygon <polygon>
- Path <path>
SVG
●

Example:
SVG
●

Output:
HTML5 Drag and Drop
●

●

In HTML5, drag and drop is part of the standard, and any
element can be drag gable.
Make an Element Drag gable
<img draggable="true">

●

The dataTransfer.setData() method sets the data type and the
value of the dragged data:
function drag(ev)
{
ev.dataTransfer.setData("Text",ev.target.id);
}
HTML5 Geolocation
●

●

●

●

The HTML5 Geolocation API is used to get the geographical
position of a user.
this can compromise user privacy, the position is not available
unless the user approves it.
In HTML5 the getCurrentPosition() method is used to get the
user's position.
Geolocation is mainly used for the following purposes:
1. Displaying the Result in a Map
2. Location-specific Information
3. Handling Errors and Rejections
HTML5 VIDEO
●

●

●

HTML5 defines a new element which specifies
a standard way to embed a video/movie on a
web page: the <video> element.
You should also insert text content between the
<video> and </video> tags for browsers that do
not support the <video> element.
The <video> element allows multiple <source>
elements. <source> elements can link to
different video files.
HTML5 VIDEO
●

Example:
HTML5 Video
●

Output:
HTML Sounds / Audio
●

The HTML5 <audio> tag defines sound, such as music or other
audio streams.

●

The <audio> element works in all modern browsers.

●

Example:
HTML5 Input Types
●

HTML5 has several new input types for forms.

●

Some of them are:
- color
- date
- email
- number
- range
- time

●

These new features allow better input control and validation.
HTML5 Form Elements
●

HTML5 has the following new form elements:
- <datalist>
- <keygen>
- <output>
HTML5 <datalist> Element
●

●

●

●

●

The <datalist> element specifies a list of pre-defined options for
an <input> element.
The <datalist> element is used to provide an "autocomplete"
feature on <input> elements.
Users will see a drop-down list of pre-defined options as they
input data.
Use the <input> element's list attribute to bind it together with a
<datalist> element.
Example: <input list="browsers">
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
</datalist>
HTML5 <keygen> Element
●

●

●

●

●

●

The purpose of the <keygen> element is to provide a secure
way to authenticate users.
The <keygen> tag specifies a key-pair generator field in a form.
When the form is submitted, two keys are generated, one
private and one public.
The private key is stored locally, and the public key is sent to
the server.
The public key could be used to generate a client certificate to
authenticate the user in the future.
Example:

<form action="demo_keygen.asp" method="get">
Username: <input type="text" name="usr_name">
Encryption: <keygen name="security">
<input type="submit">
</form>
HTML5 <output> Element
●

●

The <output> element represents the result of a calculation (like
one performed by a script).
Example:
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0
<input type="range" id="a" value="50">100 +
<input type="number" id="b" value="50">=
<output name="x" for="a b"></output>
</form>
HTML5 Form Attributes
●

HTML5 has several new attributes for <form> and <input>.

●

New attributes for <form>:
- autocomplete
- novalidate

●

New attributes for <input>:
- autocomplete

- height and width

- autofocus

- list

- form

- min and max

- formaction

- multiple

- formmethod

- pattern

- formnovalidate

- step
HTML5 Semantic Elements
●

●

A semantic element clearly describes its meaning to both the
browser and the developer.
HTML5 offers new semantic elements to clearly define different
parts of a web page:
- <header>
- <nav>
- <section>
- <article>
- <aside>
- <figcaption>
- <figure>
- <footer>
HTML5 Web Storage
●

●

●

●

●

●

With HTML5, web pages can store data locally within the user's
browser.
Web Storage is more secure and faster.
The data is not included with every server request, but used
ONLY when asked for.
It is also possible to store large amounts of data, without
affecting the website's performance.
It is also possible to store large amounts of data, without
affecting the website's performance.
There are two new objects for storing data on the client:
- localStorage - stores data with no expiration date
- sessionStorage - stores data for one session
The localStorage Object
●

●

●

The localStorage object stores the data with no
expiration date.
The data will not be deleted when the browser
is closed, and will be available the next day,
week, or year.
Example:

localStorage.lastname="Smith";
document.getElementById("result").innerHTML="Last name: "+
localStorage.lastname
The sessionStorage Object
●

●

The sessionStorage object is equal to the localStorage object,
except that it stores the data for only one session. The data is
deleted when the user closes the browser window.
Example:
if (sessionStorage.clickcount)
sessionStorage.clickcount=Number(sessionStorage.clickcount)+1;
else
sessionStorage.clickcount=1;
document.getElementById("result").innerHTML="You have clicked the button
" + sessionStorage.clickcount + " time(s) in this session.";
HTML5 Application Cache
●

●

●

●

●

HTML5 introduces application cache, which means that a web
application is cached, and accessible without an internet
connection.
Application cache gives an application three advantages:
Offline browsing - users can use the application when they're
offline
Speed - cached resources load faster
Reduced server load - the browser will only download
updated/changed resources from the server
HTML5 Web Workers
●

●

●

A web worker is a JavaScript running in the background,
without affecting the performance of the page.
You can continue to do whatever you want: clicking, selecting
things, etc., while the web worker runs in the background.
Since web workers are in external files, they do not have
access to the following JavaScript objects:
- The window object
- The document object
- The parent object
Thank You

More Related Content

ODP
Html5
PDF
The Ring programming language version 1.2 book - Part 31 of 84
PPTX
javaScript and jQuery
PDF
jQuery -Chapter 2 - Selectors and Events
PDF
D3 Basic Tutorial
PDF
Angular - Chapter 4 - Data and Event Handling
PPTX
20131108 cs query by howard
PDF
jQuery - Chapter 3 - Effects
Html5
The Ring programming language version 1.2 book - Part 31 of 84
javaScript and jQuery
jQuery -Chapter 2 - Selectors and Events
D3 Basic Tutorial
Angular - Chapter 4 - Data and Event Handling
20131108 cs query by howard
jQuery - Chapter 3 - Effects

What's hot (20)

PPTX
e-suap - client technologies- english version
PDF
Javascript and DOM
PPT
1. introduction to html5
KEY
UIWebView Tips
PDF
jQuery - Chapter 1 - Introduction
ODP
Graphics & Animation with HTML5
PDF
JavaScript - Chapter 13 - Browser Object Model(BOM)
PDF
Html 5 - What's new?
PDF
Learn D3.js in 90 minutes
PPTX
Intro to DTCoreText: Moving Past UIWebView | iOS Development
PPTX
Ajax for dummies, and not only.
PDF
Java script
PDF
Ubuntu app development
PPTX
Javascript 2
PPT
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
PDF
Unit 4(it workshop)
PDF
JavaScript
PPTX
JSON
PDF
Model-View-Update, and Beyond!
PPTX
Introduction to HTML5 Canvas
e-suap - client technologies- english version
Javascript and DOM
1. introduction to html5
UIWebView Tips
jQuery - Chapter 1 - Introduction
Graphics & Animation with HTML5
JavaScript - Chapter 13 - Browser Object Model(BOM)
Html 5 - What's new?
Learn D3.js in 90 minutes
Intro to DTCoreText: Moving Past UIWebView | iOS Development
Ajax for dummies, and not only.
Java script
Ubuntu app development
Javascript 2
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
Unit 4(it workshop)
JavaScript
JSON
Model-View-Update, and Beyond!
Introduction to HTML5 Canvas
Ad

Viewers also liked (15)

DOC
Andika Widia Putra - Perencanaan Masjid
PPT
Andika Widia Putra_Teknik Pelaksanaaan Konstruksi_Alat berat_Crane
PPT
NUTRIÇÃO
PPTX
Yeni microsoft office power point sunusu kopya
DOC
Andika Widia Putra - Desain rumah -
DOC
Andika Widia Putra - Desain Rumah
DOC
Andika Widia Putra - Perencanaan Pasar
RTF
DOC
Andika Widia Putra - Desain Rumah
PPTX
The Delivery Of Bad News In An Organizations
DOC
Andika Widia Putra - Desain Rumah
DOC
Andika Widia Putra - Desain Rumah
DOC
Andika Widia Putra - Desain Rumah
PPT
seminar on tessellation
PPT
Perilaku kelompok dalam organisasi
Andika Widia Putra - Perencanaan Masjid
Andika Widia Putra_Teknik Pelaksanaaan Konstruksi_Alat berat_Crane
NUTRIÇÃO
Yeni microsoft office power point sunusu kopya
Andika Widia Putra - Desain rumah -
Andika Widia Putra - Desain Rumah
Andika Widia Putra - Perencanaan Pasar
Andika Widia Putra - Desain Rumah
The Delivery Of Bad News In An Organizations
Andika Widia Putra - Desain Rumah
Andika Widia Putra - Desain Rumah
Andika Widia Putra - Desain Rumah
seminar on tessellation
Perilaku kelompok dalam organisasi
Ad

Similar to Html5 (20)

PPTX
New Elements & Features in HTML5
PPT
Html5 Future of WEB
PPTX
Rohit&kunjan
PPTX
PDF
Html5ppt
ODP
Html5
PPTX
Javascript note for engineering notes.pptx
PPTX
HTML 5
PPTX
Basic html5 and javascript
PDF
Html5 CSS3 jQuery Basic
PPTX
Html 5
PPT
WP - Unit I.ppt
PPT
HTML5: An Introduction To Next Generation Web Development
PPTX
JavaScripts & jQuery
PDF
Performance (browser)
PPTX
Javascript
PDF
HTML5 Refresher
PPTX
01_JavaScript_Advanced Level_Pratahb.pptx
PDF
HTML5 New Features and Resources
PPTX
PPT ON SEMINAR REPORT.pptx. bhvhvhchchvhchch
New Elements & Features in HTML5
Html5 Future of WEB
Rohit&kunjan
Html5ppt
Html5
Javascript note for engineering notes.pptx
HTML 5
Basic html5 and javascript
Html5 CSS3 jQuery Basic
Html 5
WP - Unit I.ppt
HTML5: An Introduction To Next Generation Web Development
JavaScripts & jQuery
Performance (browser)
Javascript
HTML5 Refresher
01_JavaScript_Advanced Level_Pratahb.pptx
HTML5 New Features and Resources
PPT ON SEMINAR REPORT.pptx. bhvhvhchchvhchch

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
Teaching material agriculture food technology
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Cloud computing and distributed systems.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
KodekX | Application Modernization Development
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Machine learning based COVID-19 study performance prediction
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Network Security Unit 5.pdf for BCA BBA.
Building Integrated photovoltaic BIPV_UPV.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Understanding_Digital_Forensics_Presentation.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Teaching material agriculture food technology
Big Data Technologies - Introduction.pptx
Cloud computing and distributed systems.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
KodekX | Application Modernization Development
Digital-Transformation-Roadmap-for-Companies.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Diabetes mellitus diagnosis method based random forest with bat algorithm
Machine learning based COVID-19 study performance prediction
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Network Security Unit 5.pdf for BCA BBA.

Html5

  • 1. What is HTML5 ? ● Html5 is the latest technology of the HTML standard(originally created in 1990). ● Html5 is an improvement of HTML4.0 and XHTML1.0. ● Work started in 2003 by W3C and WHATWG. ● ● ● A change from document markup language to web application language. An attempt to enhance the functionality and flexibility of the web. Html5 is language for structuring and presenting content for the World Wide Web.
  • 2. New in HTML5 Features: ● ● ● ● ● The <canvas> element for 2D drawing The <video> and <audio> elements for media playback Support for local storage New content-specific elements, like <article>, <footer>, <header>, <nav>, <section> New form controls, like calendar, date, time, email, url, search
  • 3. HTML5 Canvas ● ● ● ● ● A canvas is a rectangular area on an HTML page, and it is specified with the <canvas> element. The HTML5 <canvas> element is used to draw graphics, on the fly, via scripting (usually JavaScript). The <canvas> element is only a container for graphics. You must use a script to actually draw the graphics. Canvas has several methods for drawing paths, boxes, circles, text, and adding images. The markup looks like this: <canvas id="myCanvas" width="200" height="100"></canvas> Note: By default, the <canvas> element has no border and no content.
  • 4. Canvas Coordinates ● The canvas is a two-dimensional grid. ● The upper-left corner of the canvas has coordinate (0,0) . ● Example: Suppose we have parameters of a rectangle as(0,0,150,75): This means: Start at the upper-left corner (0,0) and draw a 150x75 pixels rectangle. ● ● ● Example: Result
  • 5. Canvas – Paths (straight line) ● To draw straight lines on a canvas, we will use the following two methods: - moveTo(x,y) defines the starting point of the line - lineTo(x,y) defines the ending point of the line ● To actually draw the line, we must use one of the "ink" methods, like stroke().
  • 6. Canvas – Paths (straight line) ● Example: at (200,200). Draw a straight line starting from (0,0) and ending
  • 7. Canvas – Paths (straight line) ● Output:
  • 8. Canvas – Paths (circle) ● To draw a circle on a canvas, we will use the following method: - arc(x,y,r,start,stop) ● To actually draw the circle, we must use one of the "ink" methods, like stroke() or fill().
  • 9. Canvas – Paths (circle) ● Example: To create a circle with the arc method.
  • 11. Canvas - Text ● To draw text on a canvas, the most important property and methods are: - font - defines the font properties for text - fillText(text,x,y) - Draws "filled" text on the canvas - strokeText(text,x,y) - Draws text on the canvas (no fill)
  • 12. Canvas - Text ● Example: Using filltext():
  • 14. What is SVG? ● SVG stands for Scalable Vector Graphics ● SVG is used to define vector-based graphics for the Web ● SVG defines the graphics in XML format ● SVG graphics do NOT lose any quality if they are zoomed or re sized ● Every element and every attribute in SVG files can be animated ● SVG is a W3C recommendation
  • 15. SVG Advantages ● Advantages of using SVG over other image formats (like JPEG and GIF) are: -These can be created and edited with any text editor - Can be searched, indexed, scripted, and compressed - Are scalable - Can be printed with high quality at any resolution - Are zoom able
  • 17. SVG Shape Elements ● SVG has some predefined shape elements that can be used by developers: - Rectangle <rect> - Circle <circle> - Ellipse <ellipse> - Line <line> - Polyline <polyline> - Polygon <polygon> - Path <path>
  • 20. HTML5 Drag and Drop ● ● In HTML5, drag and drop is part of the standard, and any element can be drag gable. Make an Element Drag gable <img draggable="true"> ● The dataTransfer.setData() method sets the data type and the value of the dragged data: function drag(ev) { ev.dataTransfer.setData("Text",ev.target.id); }
  • 21. HTML5 Geolocation ● ● ● ● The HTML5 Geolocation API is used to get the geographical position of a user. this can compromise user privacy, the position is not available unless the user approves it. In HTML5 the getCurrentPosition() method is used to get the user's position. Geolocation is mainly used for the following purposes: 1. Displaying the Result in a Map 2. Location-specific Information 3. Handling Errors and Rejections
  • 22. HTML5 VIDEO ● ● ● HTML5 defines a new element which specifies a standard way to embed a video/movie on a web page: the <video> element. You should also insert text content between the <video> and </video> tags for browsers that do not support the <video> element. The <video> element allows multiple <source> elements. <source> elements can link to different video files.
  • 25. HTML Sounds / Audio ● The HTML5 <audio> tag defines sound, such as music or other audio streams. ● The <audio> element works in all modern browsers. ● Example:
  • 26. HTML5 Input Types ● HTML5 has several new input types for forms. ● Some of them are: - color - date - email - number - range - time ● These new features allow better input control and validation.
  • 27. HTML5 Form Elements ● HTML5 has the following new form elements: - <datalist> - <keygen> - <output>
  • 28. HTML5 <datalist> Element ● ● ● ● ● The <datalist> element specifies a list of pre-defined options for an <input> element. The <datalist> element is used to provide an "autocomplete" feature on <input> elements. Users will see a drop-down list of pre-defined options as they input data. Use the <input> element's list attribute to bind it together with a <datalist> element. Example: <input list="browsers"> <datalist id="browsers"> <option value="Internet Explorer"> <option value="Firefox"> <option value="Chrome"> </datalist>
  • 29. HTML5 <keygen> Element ● ● ● ● ● ● The purpose of the <keygen> element is to provide a secure way to authenticate users. The <keygen> tag specifies a key-pair generator field in a form. When the form is submitted, two keys are generated, one private and one public. The private key is stored locally, and the public key is sent to the server. The public key could be used to generate a client certificate to authenticate the user in the future. Example: <form action="demo_keygen.asp" method="get"> Username: <input type="text" name="usr_name"> Encryption: <keygen name="security"> <input type="submit"> </form>
  • 30. HTML5 <output> Element ● ● The <output> element represents the result of a calculation (like one performed by a script). Example: <form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0 <input type="range" id="a" value="50">100 + <input type="number" id="b" value="50">= <output name="x" for="a b"></output> </form>
  • 31. HTML5 Form Attributes ● HTML5 has several new attributes for <form> and <input>. ● New attributes for <form>: - autocomplete - novalidate ● New attributes for <input>: - autocomplete - height and width - autofocus - list - form - min and max - formaction - multiple - formmethod - pattern - formnovalidate - step
  • 32. HTML5 Semantic Elements ● ● A semantic element clearly describes its meaning to both the browser and the developer. HTML5 offers new semantic elements to clearly define different parts of a web page: - <header> - <nav> - <section> - <article> - <aside> - <figcaption> - <figure> - <footer>
  • 33. HTML5 Web Storage ● ● ● ● ● ● With HTML5, web pages can store data locally within the user's browser. Web Storage is more secure and faster. The data is not included with every server request, but used ONLY when asked for. It is also possible to store large amounts of data, without affecting the website's performance. It is also possible to store large amounts of data, without affecting the website's performance. There are two new objects for storing data on the client: - localStorage - stores data with no expiration date - sessionStorage - stores data for one session
  • 34. The localStorage Object ● ● ● The localStorage object stores the data with no expiration date. The data will not be deleted when the browser is closed, and will be available the next day, week, or year. Example: localStorage.lastname="Smith"; document.getElementById("result").innerHTML="Last name: "+ localStorage.lastname
  • 35. The sessionStorage Object ● ● The sessionStorage object is equal to the localStorage object, except that it stores the data for only one session. The data is deleted when the user closes the browser window. Example: if (sessionStorage.clickcount) sessionStorage.clickcount=Number(sessionStorage.clickcount)+1; else sessionStorage.clickcount=1; document.getElementById("result").innerHTML="You have clicked the button " + sessionStorage.clickcount + " time(s) in this session.";
  • 36. HTML5 Application Cache ● ● ● ● ● HTML5 introduces application cache, which means that a web application is cached, and accessible without an internet connection. Application cache gives an application three advantages: Offline browsing - users can use the application when they're offline Speed - cached resources load faster Reduced server load - the browser will only download updated/changed resources from the server
  • 37. HTML5 Web Workers ● ● ● A web worker is a JavaScript running in the background, without affecting the performance of the page. You can continue to do whatever you want: clicking, selecting things, etc., while the web worker runs in the background. Since web workers are in external files, they do not have access to the following JavaScript objects: - The window object - The document object - The parent object