Tutorial HTML 5 in English
Tutorial HTML 5 in English
HTML5?
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
JavaScript
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
New Features
Some of the most interesting new features in HTML5:
Browser Support
HTML5 is not yet an oficial standard, and no browsers
have full
HTML5 support.
But all major browsers (Safari, Chrome, Firefox, Opera,
and Internet
Explorer) continue to add new HTML5 features to their
latest versions.
HTML5 New Elements
New Elements in HTML5
The internet has changed a lot since HTML 4.01 became a
standard in
1999.
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
Descripti
on
For external content, like text from a
news-article,
blog, forum, or any other content from an
<aside>
external source
For content aside from the content it is
placed in.
The aside content should be
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
<hgroup>
include navigation
For a section of headings, using <h1> to
<h6>,
where the largest is the main
<mark>
<meter>
<nav>
<rp>
<section>
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
<time>
<wbr>
Descripti
on
For multimedia content, sounds, music or
other
<video>
audio streams
For video content, such as a movie clip or
other
<source>
video streams
For media resources for media elements,
defined
<embed>
Descripti
on
For making graphics with a script
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
Ta
Descripti
g
on
<datalist> A list of options for input values
<keygen> Generate keys to authenticate users
<output>
search
Descripti
on
The input value is of type telephone
number
The input field is a search field
url
email
datetime
date
month
week
time
datetim
tel
e- local
number
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
range
color
HTML5 Video
IE
Firefox Opera
Ogg
No
3.5+
10.5+
Chrome Safar
i
5.0+
No
MPEG 4
No
No
No
5.0+
3.0+
WebM
No
No
10.6+
6.0+
No
codec
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
codec
How It Works
To show a video in HTML5, this is all you need:
<video src="movie.ogg" controls="controls">
</video>
Value
Description
audio
muted
autoplay
autoplay
"muted" is allowed
If present, then the video will
start
controls
controls
height
pixels
loop
loop
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
poster
url
preload
preload
src
url
width
pixels
to run. Ignored if
The URL of the video to play
Sets the width of the video
player
HTML5 Audio
Format
IE 8
Firefox Opera
Chrome Safari
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
3.5
10.5
3.0
3.0
Ogg Vorbis No
Yes
Yes
Yes
No
MP3
No
No
No
Yes
Yes
Wav
No
Yes
Yes
No
Yes
How It Works
To play an audio file in HTML5, this is all you need:
<audio src="song.ogg" controls="controls">
</audio>
Value
Description
autoplay
autoplay
controls
loop
controls
as
it is ready.
Specifies
that controls will be
loop
preload
preload
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
src
to play
url
HTML5 Canvas
The canvas element is used to draw graphics on a web
page.
What is Canvas?
The HTML5 canvas element uses JavaScript to draw
graphics on a web page.
A canvas is a rectangular area, and you control every
pixel of it.
The canvas element has several methods for drawing
paths, boxes, circles, characters, and adding images.
Create a Canvas Element
Add a canvas element to the HTML5
page. Specify the id, width, and height
of the element:
<canvas id="myCanvas" width="200"
height="100"></canvas>
<script type="text/javascript">
var c=document.getElementById("myCanvas");
ATTENTION : YOU ARE TOLD TO CHANGE THE CONTENT
var
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
cxt=c.getContext("2d"
);
cxt.fillStyle="#FF0000
";
cxt.fillRect(0,0,150,75
);
</script>
Understanding Coordinates
The fillRect method above had the parameters
(0,0,150,75).
ATTENTION : YOU ARE TOLD TO CHANGE THE CONTENT
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
url
number
range
search
color
Browser
Support
Input type
IE
Firefo
x
Opera Chrom
e
Safari
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
No
No
9.0
No
No
url
No
No
9.0
No
No
number
No
No
9.0
7.0
No
range
No
No
9.0
4.0
4.0
Date pickers
No
No
9.0
No
No
search
No
No
11.0
No
No
color
No
No
11.0
No
No
Note: Opera has the best support for the new input
types. However, you can already start using them in all
major browsers. If they are not supported, they will
behave as regular text fields.
Input Type - email
The email type is used for input fields that should
contain an e-mail address.
The value of the email field is automatically validated when
the form is
submitted.
Example
E-mail: <input type="email" name="user_email" />
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
Input Type
- url
The url type is used for input fields that should contain a
URL address. The value of the url field is automatically
validated when the form is submitted.
Example
Homepage: <input type="url" name="user_url" />
Value
number
Descripti
on
Specifies the maximum value
allowed
min
number
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
step
value
number
number
Value
max
number
min
number
Descripti
on
Specifies the maximum value
allowed
Specifies the minimum value
allowed
step
number
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
3,0,3,6, etc)
value
number
type="color"
datalist
keygen
output
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
Browser
Support
Attribute
IE
datalist
No
keygen
No
No
10.5
3.0
No
output
No
No
9.5
No
No
datalist Element
The datalist element specifies a list of options for
an input field. The list is created with option
elements inside the datalist.
To bind a datalist to an input field, let the list
attribute of the input field refer to the id of the
datalist:
Example
Webpage: <input type="url" list="url_list" name="link" />
<datalist id="url_list">
<option label="W3Schools"
value="http://www.w3schools.com" />
<option label="Google" value="http://www.google.com"
/>
<option label="Microsoft"
value="http://www.microsoft.com" />
</datalist>
keygen
Element
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
output Element
The output element is used for different types of
output, like calculations or script output:
Example
ATTENTION : YOU ARE TOLD TO CHANGE THE CONTENT
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
autocomplete
novalidate
autocomplete
autofocus
form
list
multiple
pattern (regexp)
placeholder
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
required
Browser
Support
Attribute
IE
autocomplete 8.0
autofocus
No
No
10.0
3.0
4.0
form
No
No
9.5
No
No
form
overrides
height and
No
No
10.5
No
No
8.0
3.5
9.5
3.0
4.0
No
No
9.5
No
No
No
9.5
3.0
No
width
list
step
multiple
No
3.5
11.0
3.0
4.0
novalidate
No
No
11.0
No
No
pattern
No
No
9.5
3.0
No
placeholder
No
No
11.0
3.0
3.0
required
No
No
9.5
3.0
No
autocomplete Attribute
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
types.
ATTENTION : YOU ARE TOLD TO CHANGE THE CONTENT
Example
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
form Attribute
The form attribute specifies one or more forms the input
field belongs to.
Note: The form attribute works with all <input> types.
The form attribute must refer to the id of the form it
belongs to:
Example
<form action="demo_form.asp" method="get"
id="user_form"> First name:<input type="text"
name="fname" />
<input type="submit" />
</form>
Last name: <input type="text" name="lname"
form="user_form" />
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
type="url"
list="url_list"
<datalist
id="url_list">
<option
label="W3Schools"
value="http://www.w3schools.com" />
<option
label="Google"
value="http://www.google.com" />
<option
label="Microsoft"
value="http://www.microsoft.com" />
</datalis
t>
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
<input> types:
email, and file.
ATTENTION : YOU ARE TOLD TO CHANGE THE CONTENT
Examp
le
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
novalidate Attribute
The novalidate attribute specifies that the form or
input field should not be validated when submitted.
If this attribute is present the form will not validate form
input.
Note: The novalidate attribute works with: <form> and
the following
<input> types: text, search, url, telephone, email,
password, date pickers, range, and color.
Example
<form action="demo_form.asp"
novalidate="novalidate"> E-mail: <input
type="email" name="user_email" />
<input type="submit" />
</form>
pattern Attribute
The pattern attribute specifies a pattern used to validate
an input field. The pattern is a regular expression.
Note: The pattern attribute works with the following
<input> types:
HTML 5 TUTORIAL BY
deGAHHAx.com//aa
Examp
le
HTML 5 TUTORIAL BY
deGAHHAx.com//aa