SlideShare ist ein Scribd-Unternehmen logo
1 von 57
HTML5 will be the new standard for HTML. The previous version of HTML,
HTML 4.01, came in 1999. The web has changed a lot since then. HTML5 is still a
work in progress. However, the major browsers support many of the new HTML5
elements and APIs

 Some rules for HTML5 were established:
 1. New features should be based on HTML, CSS, DOM, and JavaScript
 2. Reduce the need for external plugins (like Flash)
 3. Better error handling
 4. More markup to replace scripting
 5. HTML5 is device independent
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>   Newly added Doc-type
</head>                                element. But Not a DTD
                                            Declaration.
<body>
The content of the document......
</body>

</html>
HTML 4.01 Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


HTML 4.01 Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


HTML 4.01 Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

XHTML 1.0 Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XHTML 1.0 Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

XHTML 1.0 Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

XHTML 1.1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1. The <canvas> element for 2D drawing
2. The <video> and <audio> elements for media playback
3. Support for local storage
4. New content-specific elements, like <article>, <footer>, <header>, <nav>,
   <section>
5. New form controls, like calendar, date, time, email, url, search
Tag                                              Description
 <article>     Defines an article
 <aside>       Defines content aside from the page content
               Isolates a part of text that might be formatted in a different direction from other
   <bdi>
               text outside it
<command>      Defines a command button that a user can invoke
 <details>     Defines additional details that the user can view or hide
<summary>      Defines a visible heading for a <details> element
               Specifies self-contained content, like illustrations, diagrams, photos, code listings,
  <figure>
               etc.
<figcaption>   Defines a caption for a <figure> element
  <footer>     Defines a footer for a document or section
 <header>      Defines a header for a document or section
 <hgroup>      Groups a set of <h1> to <h6> elements when a heading has multiple levels
   <mark>      Defines marked/highlighted text
  <meter>      Defines a scalar measurement within a known range (a gauge)
    <nav>      Defines navigation links
<progress>   Represents the progress of a task
  <ruby>     Defines a ruby annotation (for East Asian typography)
   <rt>      Defines an explanation/pronunciation of characters (for East Asian typography)
  <rp>       Defines what to show in browsers that do not support ruby annotations
<section>    Defines a section in a document
 <time>      Defines a date/time
 <wbr>       Defines a possible line-break
New Media Elements
Tag               Description
<audio>           Defines sound content
<video>           Defines a video or movie
<source>          Defines multiple media resources for <video> and <audio>
<embed>           Defines a container for an external application or interactive content (a plug-in)
<track>           Defines text tracks for <video> and <audio>

New Form Elements
Tag          Description
<datalist>   Specifies a list of pre-defined options for input controls
<keygen>     Defines a key-pair generator field (for forms)
<output>     Defines the result of a calculation


Canvas Elements
Tag          Description
<canvas>     Used to draw graphics, on the fly, via scripting (usually JavaScript
1. <acronym>
2. <applet>
3. <basefont>
4. <big>
5. <center>
6. <dir>
7. <font>
8. <frame>
9. <frameset>
10. <noframes>
11. <strike>
12. <tt>
13. <u>
Until now, there has not been a standard for showing a video/movie on a web page.
Today, most videos are shown through a plug-in (like flash). However, different
browsers may have different plug-ins.
HTML5 defines a new element which specifies a standard way to embed a
video/movie on a web page: the <video> element.

 Example
 <!DOCTYPE html />
 <html>
 <body>
 <video width="320" height="240" controls="controls">
  <source src="2.mp4" type="video/mp4" />
 </video>
 <br>
 <video width="320" height="240" controls="controls">
  <source src="1.wmv" type="video/wmv" />
   Your browser does not support the video tag.
 </video>
 </body>
 </html>
Video Formats and Browser Support


Browser               MP4           WebM   Ogg
Internet Explorer 9   YES           NO     NO
Firefox 4.0           NO            YES    YES
Google Chrome 6       YES           YES    YES
Apple Safari 5        YES           NO     NO
Opera 10.6            NO            YES    YES
Until now, there has not been a standard for playing audio files on a web page.
Today, most audio files are played through a plug-in (like flash). However, different
browsers may have different plug-ins.
HTML5 defines a new element which specifies a standard way to embed an audio file
on a web page: the <audio> element.
Example

<!DOCTYPE html>
<html>
<body>
<audio controls="controls">
 <source src="audio.mp3" type="audio/mpeg" />
Your browser does not support the audio element.
</audio>
</body>
</html>
Note : You should also insert text content between the <audio> and </audio> tags for browsers that do not
support the <audio> element.
Audio Formats and Browser Support


Browser                MP3           Wav   Ogg
Internet Explorer 9    YES           NO    NO
Firefox 4.0            NO            YES   YES
Google Chrome 6        YES           YES   YES
Apple Safari 5         YES           YES   NO
Opera 10.6             NO            YES   YES
The meter element defines a scalar measurement within a known range, similar to
what might be represented by a gauge.

The progress element, which defines completion progress for some task.
Commonly, this element might represent the percentage from 0 percent to 100
percent of a task, such as loading to be completed:

<!DOCTYPE html>
<html>
<body>
<p>Progress: <progress id="progressBar" max="100.00" value="33.1">
33.1%</progress></p>
<br>
<p>Warp Drive Output: <meter min="0" max="10" low="3" optimum="7" high="9"
value="9.5" title="Captain she can't take much more of this!"></meter></p>
<input type="submit" />
</form>
</body>
</html>
HTML5 has added following 3 Form Elements

1. <datalist>
2. <keygen>
3. <output>
1. The <datalist> element specifies a list of pre-defined options for an <input>
   element.
2. 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.
3. Use the <input> element's list attribute to bind it together with a <datalist>
   element.


 <!DOCTYPE html>
 <html>
 <body>
 <form action="demo_form.asp" method="get">
 <input list="browsers" name="browser" />
 <datalist id="browsers">
  <option value="Internet Explorer">
  <option value="Firefox"> <option value="Chrome"> <option value="Opera">
  <option value="Safari"> </datalist>
 <input type="submit" />
 </form> </body> </html>
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.

  <!DOCTYPE html>
  <html>
  <body>
  <form action="demo_keygen.asp" method="get">
  Username: <input type="text" name="usr_name" />
  Encryption: <keygen name="security" />
  <input type="submit" />
  </form>
  </body>
  </html>
The <output> element represents the result of a calculation (like one performed by a
script).

<!DOCTYPE html>
<html>
<body>
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0
<input type="range" name="a" value="50" />100
+<input type="number" name="b" value="50" />
=<output name="x" for="a b"></output>
</form>
</body>
</html>
Traditionally, the HTML input element is used to define most form fields. The particular
type of form field of interest is defined with the type attribute, which is set to text,
password, hidden, checkbox, radio, submit, reset, image, or button. HTML5 adds quite
a number of other values, which we will briefly explore here.
<p><label>color:<input type="color" name="favColor"></label></p>

As of the time of this edition’s writing, no implementation existed for this control, but it
might look something like this:
A variety of date controls can now be directly created by setting the type attribute to
date, datetime, datetime-local, month, week, or time.

<p><label>date:
<input type="date" name="date">
</label></p>
<p><label>datetime:
<input type="datetime" name="datetime">
</label></p>
<p><label>datetime-local:
<input type="datetime-local" name="datetime2">
</label></p>
<p><label>time:
<input type="time" name="time">
</label></p>
<p><label>month:
<input type="month" name="month">
</label></p>
<p><label>week:
<input type="week" name="week">
</label></p>
<!DOCTYPE html>
<html>
<body>
<form action="http://www.google.com">
<p><label>number:<input type="number" name="number"></label></p>
<input type="number" name="number2" min="-5" max="25" step="5">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<form action="http://www.google.com">
<input type="range" name="range" max="100" min="1" step="5">
<p><label>range (1-100 step 5):
              <input type="range" name="range" max="100" min="1" step="5">
</label></p>
<p><label>range (-1000-1000 step 100):
<input type="range" name="range" max="1000" min="-1000" step="100">
</label></p>
<p><label>range (-.25 to 3.0)<input id="slider3" type ="range" min ="-2.5" max="3.0"
step ="0.1"/>
</form>
</body>
</html>
The new details element is supposed to represent some form of extra details, such as a
tooltip or revealed region that may be shown to a user



  <details onclick="this.open='open'">
  <dt>Help?</dt>
  <dd>This could give you help with HTML5 but we need more
  implementations to prove how things will work.</dd>
  </details>
<!DOCTYPE html>
<html>
<body>
<label>Text area: (spellcheck on) <textarea name="comments"
spellcheck="true">There is a tyyypooo here. Did the browser spot it?
</textarea></label>
</body>
</html>
1. <input type="color" name="favcolor" />
2. <input type="date" name="bday" />
3. <input type="datetime" name="bdaytime" />
4. <input type="datetime-local" name="bdaytime" />
5. <input type="email" name="usremail" />
6. <input type="month" name="bdaymonth" />
7. <input type="number" name="quantity" min="1" max="5" />
8. <input type="range" name="points" min="1" max="10" />
9. <input type="tel" name="usrtel" />
10. <input type="time" name="usr_time" />
11. <input type="url" name="homepage" />
12. <input type="week" name="week_year" />
<!DOCTYPE html>
<html>
<body>
<p contenteditable="true">This paragraph of text is editable. Click it and you will see.
Of course there is no sense of saving it with code to transmit the information to the
server. This paragraph of text is editable. Click it and you will see. Of course there is no
sense of saving it with code to transmit the information to the server.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<label for="phonenum" class="required">Phone Number:</label>
<input type="text" name="phonenum" id="phonenum"
required pattern="^(d{3}) d{3}-d{4}$"
title="Phone number of form (xxx) xxx-xxxx required">
<input type="submit" value="go to goole "/>
</form>
</body>
</html>
The pattern attribute specifies a regular expression that the <input> element's value is
checked against.
Note: The pattern attribute works with the following input types: text, search, url, tel,
email, and password.


<!DOCTYPE html>
<html>
<body>
<form action="demo_form.asp">
 Country code: <input type="text" name="country_code"
pattern="[A-Za-z]{3}" title="Three letter country code" />
 <input type="submit" />
</form>
</body>
</html>
The required attribute is a boolean attribute. When present, it specifies that an input
field must be filled out before submitting the form.
Note: The required attribute works with the following input types: text, search, url,
tel, email, password, date pickers, number, checkbox, radio, and file.


<!DOCTYPE html>
<html>
<body>
<form action="demo_form.asp">
 Username: <input type="text" name="username" required="required" />
 <input type="submit" />
</form>
</body>
</html>
The placeholder attribute specifies a short hint that describes the expected value of an
input field
Note: The placeholder attribute works with the following input types: text, search, url,
tel, email, and password.

<!DOCTYPE html>
<html>
<body>

<form action="demo_form.asp">
 <input type="text" name="fname" placeholder="First name" /><br />
 <input type="text" name="lname" placeholder="Last name" /><br />
 <input type="submit" value="Submit" />
</form>

</body>
</html>
The email type is used for input fields that should contain an e-mail address.


  <!DOCTYPE html>
  <html>
  <body>
  <form action="demo_form.asp">
   E-mail: <input type="email" name="usremail" /><br />
   <input type="submit" />
  </form>
  </body>
  </html>
The novalidate attribute is a boolean attribute. When present, it specifies that the
form-data (input) should not be validated when submitted.

<!DOCTYPE html>
<html>
<body>
<form action="demo_form.asp" novalidate>
E-mail: <input type="email" name="useremail" required/>
<input type="submit" />
</form>
</body>
</html>
The autofocus attribute is a boolean attribute. When present, it specifies that an
<input> element should automatically get focus when the page loads.




  <!DOCTYPE html>
  <html>
  <body>

  <form action="demo_form.asp">
   First name:<input type="text" name="fname" autofocus="autofocus" /><br />
   Last name: <input type="text" name="lname" /><br />
   <input type="submit" />
  </form>

  </body>
  </html>
The form attribute specifies one or more forms an <input> element belongs to.
 Tip: To refer to more than one form, use a space-separated list of form ids.

<!DOCTYPE html>
<html>
<body>
<form action="demo_form.asp" id="form1">
First name: <input type="text" name="fname" /><br />
<input type="submit" value="Submit" />
</form>
<p>The "Last name" field below is outside the form element, but still part of the form.</p>
Last name: <input type="text" name="lname" form="form1" />
</body>
</html>
The formaction attribute specifies the URL of a file that will process the input control
 when the form is submitted.
 The formaction attribute overrides the action attribute of the <form> element
<!DOCTYPE html>
<html>
<body>
<form action="demo_form.asp">
 First name: <input type="text" name="fname" /><br />
 Last name: <input type="text" name="lname" /><br />
 <input type="submit" value="Submit" /><br />
 <input type="submit" formaction=“Page2.aspx" value="Submit as admin" />
</form>
</body>
</html>
The formmethod attribute defines the HTTP method for sending form-data to the
action URL. The formmethod attribute overrides the method attribute of the <form>
element.

<!DOCTYPE html>
<html>
<body>
<form action="demo_form.asp" method="get">
 First name: <input type="text" name="fname" /><br />
 Last name: <input type="text" name="lname" /><br />
 <input type="submit" value="Submit" />
 <input type="submit" formmethod="post" formaction="demo_post.asp" value="Submit
using POST" />
</form>
</body>
</html>
The novalidate attribute is a boolean attribute. When present, it specifies that the
<input> element should not be validated when submitted. The formnovalidate attribute
overrides the novalidate attribute of the <form> element

  <!DOCTYPE html>
  <html>
  <body>

  <form action="demo_form.asp">
   E-mail: <input type="email" name="userid" /><br />
   <input type="submit" value="Submit" /><br />
   <input type="submit" formnovalidate="formnovalidate" value="Submit without validation" />
  </form>

  </body>
  </html>
Value         Description
  _blank        The response is displayed in a new window or tab
  _self         The response is displayed in the same frame (this is default)
  _parent       The response is displayed in the parent frame
  _top          The response is displayed in the full body of the window
  framename     The response is displayed in a named iframe


<!DOCTYPE html> <html> <body>
<form action="demo_form.asp">
 First name: <input type="text" name="fname" /><br />
 Last name: <input type="text" name="lname" /><br />
 <input type="submit" value="Submit as normal" />
 <input type="submit" formtarget="_blank" value="Submit to a new window/tab" />
</form>
</body>
</html>
HTML5 defines a standard way to include developer-defined data attributes in tags,
often for the consumption by scripts. The general idea is to use the prefix data- and
then pick a variable name to include some non-visual data on a tag.

<p id="p1" data-author="Thomas A. Powell">This is a data-X example</p>

Reading meta data using Standard Dom
<form>
<input type="button" value="Show Author" onclick="alert(document.
getElementById('p1').getAttribute('data-author')); ">
</form>

HTML5 DOM objects and properties
<form>
<input type="button" value="Show Author" onclick="alert(document.
getElementById('p1').dataset.author);">
</form>
1. The HTML5 <canvas> element is used to draw graphics, on the fly, via scripting
   (usually JavaScript).
2. The <canvas> element is only a container for graphics, you must use a script to
   actually draw the graphics.
3. A canvas is a drawable region defined in HTML code with height and width
   attributes.
4. Canvas has several methods for drawing paths, boxes, circles, characters, and
   adding images.

<canvas id="myCanvas" width="200" height="100"></canvas>

Note : The <canvas> element has no drawing abilities of its own. All drawing must
be done inside a JavaScript:
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3c3c3;">
Your browser does not support the canvas element.
</canvas>
<script type="text/javascript“>
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.fillStyle="#FF0000";
ctx.fillRect(0,0,150,75);
</script>
</body>
</html>
The HTML5 Geolocation API is used to get the geographical position of a user. Since this
can compromise user privacy, the position is not available unless the user approves it.

1. It usages Use the getCurrentPosition() method to get the user's position

The getCurrentPosition() Method return following information
Property                  Description
coords.latitude           The latitude as a decimal number
coords.longitude          The longitude as a decimal number
coords.accuracy           The accuracy of position

coords.altitude           The altitude in meters above the mean sea level

coords.altitudeAccuracy   The altitude accuracy of position
coords.heading            The heading as degrees clockwise from North
coords.speed              The speed in meters per second
timestamp                 The date/time of the response
<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to get your coordinates:</p>
<button onclick="getLocation()">Try It</button>
<script>
var x=document.getElementById("demo");
function getLocation()
 {
 if (navigator.geolocation)
   {
   navigator.geolocation.getCurrentPosition(showPosition);
   }
 else{x.innerHTML="Geolocation is not supported by this browser.";}
 }
function showPosition(position)
 {
 x.innerHTML="Latitude: " + position.coords.latitude +
 "<br />Longitude: " + position.coords.longitude;
 }
</script>
</body>
</html>

http://abkeya.com/blog/2011/02/using-navigator-geolocation-getcurrentposition-to-display-
user%E2%80%99s-current-location-on-google-map-and-getting-user-input/
1. With HTML5, web pages can store data locally within the user's browser.
2. Earlier, this was done with cookies.
3. Web Storage is more secure and faster. The data is not included with every server
   request, but used ONLY when asked for.
4. It is also possible to store large amounts of data, without affecting the website's
   performance.
5. The data is stored in key/value pairs, and a web page can only access data stored by
   itself

There are two new objects for storing data on the client:

1. localStorage - stores data with no expiration date
2. sessionStorage - stores data for one session
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.


<!DOCTYPE html>
<html>
<body>
<div id="result"></div>
<script>
if(typeof(Storage)!=="undefined")
 {
 localStorage.lastname="Smith";
 document.getElementById("result").innerHTML="Last name: " + localStorage.lastname;
 }
else
 {
 document.getElementById("result").innerHTML="Sorry, your browser does not support web storage...";
 }
</script>
</body>
</html>
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
<!DOCTYPE html>
<html> <head> <script>
function clickCounter()
{
if(typeof(Storage)!=="undefined")
  {
  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.";
  }
else
  {
  document.getElementById("result").innerHTML="Sorry, your browser does not support web storage...";
  }
}
</script> </head> <body> <p><button onclick="clickCounter()" type="button">Click me!</button></p>
<div id="result"></div> <p>Click the button to see the counter increase.</p>
<p>Close the browser tab (or window), and try again, and the counter is reset.</p> </body>
</html>
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:
1. Offline browsing - users can use the application when they're offline
2. Speed - cached resources load faster
3. Reduced server load - the browser will only download updated/changed
   resources from the server
1. To enable application cache, include the manifest attribute in the document's
   <html> tag:
2. Every page with the manifest attribute specified will be cached when the user
   visits it.
3. If the manifest attribute is not specified, the page will not be cached (unless the
   page is specified directly in the manifest file).
4. The recommended file extension for manifest files is: ".appcache”
5. A manifest file needs to be served with the correct MIME-type, which is
   "text/cache-manifest". Must be configured on the web server.
The manifest file is a simple text file, which tells the browser what to cache.
   The manifest file has three sections:
  1. CACHE MANIFEST - Files listed under this header will be cached after they are
      downloaded for the first time
   2. NETWORK - Files listed under this header require a connection to the server, and
      will never be cached
  3. FALLBACK - Files listed under this header specifies fallback pages if a page is
  inaccessible

abc.appcache
CACHE MANIFEST                             <!DOCTYPE html>
# 2012-02-21 v1.0.0
                                           <html lang="en" manifest="/abc.appcache">
/theme.css
/logo.gif                                   // your html document
/main.js                                   </html>

NETWORK:
login.asp

FALLBACK:
/html5/ /offline.html
Cache Expires on any of the following cases.

1. The user clears the browser's cache
2. The manifest file is modified (see tip below)
3. The application cache is programmatically updated
HTML5 Replacement of Flash
http://www.techrepublic.com/blog/webmaster/how-to-replace-flash-and-silverlight-
with-html5/995


HTML5 for Mobile
http://www.engineyard.com/blog/2011/mobile-development-with-html5/
http://www.mobilehtml5.com/


HTML5 for Storage
http://diveintohtml5.info/storage.html
http://php-html.net/tutorials/html5-local-storage-guide/


HTML Cache
http://html5doctor.com/go-offline-with-application-cache/

Weitere ähnliche Inhalte

Was ist angesagt?

Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginnersSingsys Pte Ltd
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overviewJacob Nelson
 
HTML5 - Introduction
HTML5 - IntroductionHTML5 - Introduction
HTML5 - IntroductionDavy De Pauw
 
1. introduction to html5
1. introduction to html51. introduction to html5
1. introduction to html5JayjZens
 
HTML Web design english & sinhala mix note
HTML Web design english & sinhala mix noteHTML Web design english & sinhala mix note
HTML Web design english & sinhala mix noteMahinda Gamage
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5Robert Nyman
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookScottperrone
 
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]Aaron Gustafson
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Terry Ryan
 
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)Clément Wehrung
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Startedguest1af57e
 
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 XHTMLHowpk
 

Was ist angesagt? (20)

Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
 
Html5
Html5Html5
Html5
 
HTML5
HTML5HTML5
HTML5
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
HTML5 - Introduction
HTML5 - IntroductionHTML5 - Introduction
HTML5 - Introduction
 
1. introduction to html5
1. introduction to html51. introduction to html5
1. introduction to html5
 
HTML Web design english & sinhala mix note
HTML Web design english & sinhala mix noteHTML Web design english & sinhala mix note
HTML Web design english & sinhala mix note
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - Ebook
 
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
 
Session4
Session4Session4
Session4
 
Training HTML
Training HTMLTraining HTML
Training HTML
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
 
Xhtml 2010
Xhtml 2010Xhtml 2010
Xhtml 2010
 
Web technologies part-2
Web technologies part-2Web technologies part-2
Web technologies part-2
 
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
 

Ähnlich wie Html5 tutorial

Ähnlich wie Html5 tutorial (20)

HTML5-Tutorial-For-Beginn.6202488.pptx
HTML5-Tutorial-For-Beginn.6202488.pptxHTML5-Tutorial-For-Beginn.6202488.pptx
HTML5-Tutorial-For-Beginn.6202488.pptx
 
Html 5
Html 5Html 5
Html 5
 
41915024 html-5
41915024 html-541915024 html-5
41915024 html-5
 
HTML5 Refresher
HTML5 RefresherHTML5 Refresher
HTML5 Refresher
 
Html5
Html5Html5
Html5
 
Html5
Html5Html5
Html5
 
Html5 tags
Html5 tagsHtml5 tags
Html5 tags
 
HTML5.pptx
HTML5.pptxHTML5.pptx
HTML5.pptx
 
Html 5
Html 5Html 5
Html 5
 
HTML5 Introduction
HTML5 IntroductionHTML5 Introduction
HTML5 Introduction
 
HTML5 Presentation
HTML5 PresentationHTML5 Presentation
HTML5 Presentation
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)
 
Getting started with html5
Getting started with html5Getting started with html5
Getting started with html5
 
Introduction to html55
Introduction to html55Introduction to html55
Introduction to html55
 
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5
 
HTML5 tags.ppt
HTML5 tags.pptHTML5 tags.ppt
HTML5 tags.ppt
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
1._Introduction_to_HTML5[1].MCA MODULE 1 NOTES
1._Introduction_to_HTML5[1].MCA MODULE 1 NOTES1._Introduction_to_HTML5[1].MCA MODULE 1 NOTES
1._Introduction_to_HTML5[1].MCA MODULE 1 NOTES
 
1. Introduction to HTML5.ppt
1. Introduction to HTML5.ppt1. Introduction to HTML5.ppt
1. Introduction to HTML5.ppt
 

Kürzlich hochgeladen

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Kürzlich hochgeladen (20)

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

Html5 tutorial

  • 1.
  • 2. HTML5 will be the new standard for HTML. The previous version of HTML, HTML 4.01, came in 1999. The web has changed a lot since then. HTML5 is still a work in progress. However, the major browsers support many of the new HTML5 elements and APIs Some rules for HTML5 were established: 1. New features should be based on HTML, CSS, DOM, and JavaScript 2. Reduce the need for external plugins (like Flash) 3. Better error handling 4. More markup to replace scripting 5. HTML5 is device independent
  • 3. <!DOCTYPE html> <html> <head> <title>Title of the document</title> Newly added Doc-type </head> element. But Not a DTD Declaration. <body> The content of the document...... </body> </html>
  • 4. HTML 4.01 Strict <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> HTML 4.01 Transitional <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> HTML 4.01 Frameset <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> XHTML 1.0 Strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> XHTML 1.0 Transitional <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> XHTML 1.0 Frameset <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> XHTML 1.1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  • 5. 1. The <canvas> element for 2D drawing 2. The <video> and <audio> elements for media playback 3. Support for local storage 4. New content-specific elements, like <article>, <footer>, <header>, <nav>, <section> 5. New form controls, like calendar, date, time, email, url, search
  • 6. Tag Description <article> Defines an article <aside> Defines content aside from the page content Isolates a part of text that might be formatted in a different direction from other <bdi> text outside it <command> Defines a command button that a user can invoke <details> Defines additional details that the user can view or hide <summary> Defines a visible heading for a <details> element Specifies self-contained content, like illustrations, diagrams, photos, code listings, <figure> etc. <figcaption> Defines a caption for a <figure> element <footer> Defines a footer for a document or section <header> Defines a header for a document or section <hgroup> Groups a set of <h1> to <h6> elements when a heading has multiple levels <mark> Defines marked/highlighted text <meter> Defines a scalar measurement within a known range (a gauge) <nav> Defines navigation links
  • 7. <progress> Represents the progress of a task <ruby> Defines a ruby annotation (for East Asian typography) <rt> Defines an explanation/pronunciation of characters (for East Asian typography) <rp> Defines what to show in browsers that do not support ruby annotations <section> Defines a section in a document <time> Defines a date/time <wbr> Defines a possible line-break
  • 8. New Media Elements Tag Description <audio> Defines sound content <video> Defines a video or movie <source> Defines multiple media resources for <video> and <audio> <embed> Defines a container for an external application or interactive content (a plug-in) <track> Defines text tracks for <video> and <audio> New Form Elements Tag Description <datalist> Specifies a list of pre-defined options for input controls <keygen> Defines a key-pair generator field (for forms) <output> Defines the result of a calculation Canvas Elements Tag Description <canvas> Used to draw graphics, on the fly, via scripting (usually JavaScript
  • 9. 1. <acronym> 2. <applet> 3. <basefont> 4. <big> 5. <center> 6. <dir> 7. <font> 8. <frame> 9. <frameset> 10. <noframes> 11. <strike> 12. <tt> 13. <u>
  • 10. Until now, there has not been a standard for showing a video/movie on a web page. Today, most videos are shown through a plug-in (like flash). However, different browsers may have different plug-ins. HTML5 defines a new element which specifies a standard way to embed a video/movie on a web page: the <video> element. Example <!DOCTYPE html /> <html> <body> <video width="320" height="240" controls="controls"> <source src="2.mp4" type="video/mp4" /> </video> <br> <video width="320" height="240" controls="controls"> <source src="1.wmv" type="video/wmv" /> Your browser does not support the video tag. </video> </body> </html>
  • 11. Video Formats and Browser Support Browser MP4 WebM Ogg Internet Explorer 9 YES NO NO Firefox 4.0 NO YES YES Google Chrome 6 YES YES YES Apple Safari 5 YES NO NO Opera 10.6 NO YES YES
  • 12. Until now, there has not been a standard for playing audio files on a web page. Today, most audio files are played through a plug-in (like flash). However, different browsers may have different plug-ins. HTML5 defines a new element which specifies a standard way to embed an audio file on a web page: the <audio> element. Example <!DOCTYPE html> <html> <body> <audio controls="controls"> <source src="audio.mp3" type="audio/mpeg" /> Your browser does not support the audio element. </audio> </body> </html> Note : You should also insert text content between the <audio> and </audio> tags for browsers that do not support the <audio> element.
  • 13. Audio Formats and Browser Support Browser MP3 Wav Ogg Internet Explorer 9 YES NO NO Firefox 4.0 NO YES YES Google Chrome 6 YES YES YES Apple Safari 5 YES YES NO Opera 10.6 NO YES YES
  • 14. The meter element defines a scalar measurement within a known range, similar to what might be represented by a gauge. The progress element, which defines completion progress for some task. Commonly, this element might represent the percentage from 0 percent to 100 percent of a task, such as loading to be completed: <!DOCTYPE html> <html> <body> <p>Progress: <progress id="progressBar" max="100.00" value="33.1"> 33.1%</progress></p> <br> <p>Warp Drive Output: <meter min="0" max="10" low="3" optimum="7" high="9" value="9.5" title="Captain she can't take much more of this!"></meter></p> <input type="submit" /> </form> </body> </html>
  • 15. HTML5 has added following 3 Form Elements 1. <datalist> 2. <keygen> 3. <output>
  • 16. 1. The <datalist> element specifies a list of pre-defined options for an <input> element. 2. 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. 3. Use the <input> element's list attribute to bind it together with a <datalist> element. <!DOCTYPE html> <html> <body> <form action="demo_form.asp" method="get"> <input list="browsers" name="browser" /> <datalist id="browsers"> <option value="Internet Explorer"> <option value="Firefox"> <option value="Chrome"> <option value="Opera"> <option value="Safari"> </datalist> <input type="submit" /> </form> </body> </html>
  • 17. 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. <!DOCTYPE html> <html> <body> <form action="demo_keygen.asp" method="get"> Username: <input type="text" name="usr_name" /> Encryption: <keygen name="security" /> <input type="submit" /> </form> </body> </html>
  • 18. The <output> element represents the result of a calculation (like one performed by a script). <!DOCTYPE html> <html> <body> <form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0 <input type="range" name="a" value="50" />100 +<input type="number" name="b" value="50" /> =<output name="x" for="a b"></output> </form> </body> </html>
  • 19. Traditionally, the HTML input element is used to define most form fields. The particular type of form field of interest is defined with the type attribute, which is set to text, password, hidden, checkbox, radio, submit, reset, image, or button. HTML5 adds quite a number of other values, which we will briefly explore here.
  • 20. <p><label>color:<input type="color" name="favColor"></label></p> As of the time of this edition’s writing, no implementation existed for this control, but it might look something like this:
  • 21. A variety of date controls can now be directly created by setting the type attribute to date, datetime, datetime-local, month, week, or time. <p><label>date: <input type="date" name="date"> </label></p> <p><label>datetime: <input type="datetime" name="datetime"> </label></p> <p><label>datetime-local: <input type="datetime-local" name="datetime2"> </label></p> <p><label>time: <input type="time" name="time"> </label></p> <p><label>month: <input type="month" name="month"> </label></p> <p><label>week: <input type="week" name="week"> </label></p>
  • 22.
  • 23. <!DOCTYPE html> <html> <body> <form action="http://www.google.com"> <p><label>number:<input type="number" name="number"></label></p> <input type="number" name="number2" min="-5" max="25" step="5"> </form> </body> </html>
  • 24. <!DOCTYPE html> <html> <body> <form action="http://www.google.com"> <input type="range" name="range" max="100" min="1" step="5"> <p><label>range (1-100 step 5): <input type="range" name="range" max="100" min="1" step="5"> </label></p> <p><label>range (-1000-1000 step 100): <input type="range" name="range" max="1000" min="-1000" step="100"> </label></p> <p><label>range (-.25 to 3.0)<input id="slider3" type ="range" min ="-2.5" max="3.0" step ="0.1"/> </form> </body> </html>
  • 25. The new details element is supposed to represent some form of extra details, such as a tooltip or revealed region that may be shown to a user <details onclick="this.open='open'"> <dt>Help?</dt> <dd>This could give you help with HTML5 but we need more implementations to prove how things will work.</dd> </details>
  • 26. <!DOCTYPE html> <html> <body> <label>Text area: (spellcheck on) <textarea name="comments" spellcheck="true">There is a tyyypooo here. Did the browser spot it? </textarea></label> </body> </html>
  • 27. 1. <input type="color" name="favcolor" /> 2. <input type="date" name="bday" /> 3. <input type="datetime" name="bdaytime" /> 4. <input type="datetime-local" name="bdaytime" /> 5. <input type="email" name="usremail" /> 6. <input type="month" name="bdaymonth" /> 7. <input type="number" name="quantity" min="1" max="5" /> 8. <input type="range" name="points" min="1" max="10" /> 9. <input type="tel" name="usrtel" /> 10. <input type="time" name="usr_time" /> 11. <input type="url" name="homepage" /> 12. <input type="week" name="week_year" />
  • 28. <!DOCTYPE html> <html> <body> <p contenteditable="true">This paragraph of text is editable. Click it and you will see. Of course there is no sense of saving it with code to transmit the information to the server. This paragraph of text is editable. Click it and you will see. Of course there is no sense of saving it with code to transmit the information to the server.</p> </body> </html>
  • 29. <!DOCTYPE html> <html> <body> <label for="phonenum" class="required">Phone Number:</label> <input type="text" name="phonenum" id="phonenum" required pattern="^(d{3}) d{3}-d{4}$" title="Phone number of form (xxx) xxx-xxxx required"> <input type="submit" value="go to goole "/> </form> </body> </html>
  • 30. The pattern attribute specifies a regular expression that the <input> element's value is checked against. Note: The pattern attribute works with the following input types: text, search, url, tel, email, and password. <!DOCTYPE html> <html> <body> <form action="demo_form.asp"> Country code: <input type="text" name="country_code" pattern="[A-Za-z]{3}" title="Three letter country code" /> <input type="submit" /> </form> </body> </html>
  • 31.
  • 32.
  • 33.
  • 34. The required attribute is a boolean attribute. When present, it specifies that an input field must be filled out before submitting the form. Note: The required attribute works with the following input types: text, search, url, tel, email, password, date pickers, number, checkbox, radio, and file. <!DOCTYPE html> <html> <body> <form action="demo_form.asp"> Username: <input type="text" name="username" required="required" /> <input type="submit" /> </form> </body> </html>
  • 35. The placeholder attribute specifies a short hint that describes the expected value of an input field Note: The placeholder attribute works with the following input types: text, search, url, tel, email, and password. <!DOCTYPE html> <html> <body> <form action="demo_form.asp"> <input type="text" name="fname" placeholder="First name" /><br /> <input type="text" name="lname" placeholder="Last name" /><br /> <input type="submit" value="Submit" /> </form> </body> </html>
  • 36. The email type is used for input fields that should contain an e-mail address. <!DOCTYPE html> <html> <body> <form action="demo_form.asp"> E-mail: <input type="email" name="usremail" /><br /> <input type="submit" /> </form> </body> </html>
  • 37. The novalidate attribute is a boolean attribute. When present, it specifies that the form-data (input) should not be validated when submitted. <!DOCTYPE html> <html> <body> <form action="demo_form.asp" novalidate> E-mail: <input type="email" name="useremail" required/> <input type="submit" /> </form> </body> </html>
  • 38. The autofocus attribute is a boolean attribute. When present, it specifies that an <input> element should automatically get focus when the page loads. <!DOCTYPE html> <html> <body> <form action="demo_form.asp"> First name:<input type="text" name="fname" autofocus="autofocus" /><br /> Last name: <input type="text" name="lname" /><br /> <input type="submit" /> </form> </body> </html>
  • 39. The form attribute specifies one or more forms an <input> element belongs to. Tip: To refer to more than one form, use a space-separated list of form ids. <!DOCTYPE html> <html> <body> <form action="demo_form.asp" id="form1"> First name: <input type="text" name="fname" /><br /> <input type="submit" value="Submit" /> </form> <p>The "Last name" field below is outside the form element, but still part of the form.</p> Last name: <input type="text" name="lname" form="form1" /> </body> </html>
  • 40. The formaction attribute specifies the URL of a file that will process the input control when the form is submitted. The formaction attribute overrides the action attribute of the <form> element <!DOCTYPE html> <html> <body> <form action="demo_form.asp"> First name: <input type="text" name="fname" /><br /> Last name: <input type="text" name="lname" /><br /> <input type="submit" value="Submit" /><br /> <input type="submit" formaction=“Page2.aspx" value="Submit as admin" /> </form> </body> </html>
  • 41. The formmethod attribute defines the HTTP method for sending form-data to the action URL. The formmethod attribute overrides the method attribute of the <form> element. <!DOCTYPE html> <html> <body> <form action="demo_form.asp" method="get"> First name: <input type="text" name="fname" /><br /> Last name: <input type="text" name="lname" /><br /> <input type="submit" value="Submit" /> <input type="submit" formmethod="post" formaction="demo_post.asp" value="Submit using POST" /> </form> </body> </html>
  • 42. The novalidate attribute is a boolean attribute. When present, it specifies that the <input> element should not be validated when submitted. The formnovalidate attribute overrides the novalidate attribute of the <form> element <!DOCTYPE html> <html> <body> <form action="demo_form.asp"> E-mail: <input type="email" name="userid" /><br /> <input type="submit" value="Submit" /><br /> <input type="submit" formnovalidate="formnovalidate" value="Submit without validation" /> </form> </body> </html>
  • 43. Value Description _blank The response is displayed in a new window or tab _self The response is displayed in the same frame (this is default) _parent The response is displayed in the parent frame _top The response is displayed in the full body of the window framename The response is displayed in a named iframe <!DOCTYPE html> <html> <body> <form action="demo_form.asp"> First name: <input type="text" name="fname" /><br /> Last name: <input type="text" name="lname" /><br /> <input type="submit" value="Submit as normal" /> <input type="submit" formtarget="_blank" value="Submit to a new window/tab" /> </form> </body> </html>
  • 44. HTML5 defines a standard way to include developer-defined data attributes in tags, often for the consumption by scripts. The general idea is to use the prefix data- and then pick a variable name to include some non-visual data on a tag. <p id="p1" data-author="Thomas A. Powell">This is a data-X example</p> Reading meta data using Standard Dom <form> <input type="button" value="Show Author" onclick="alert(document. getElementById('p1').getAttribute('data-author')); "> </form> HTML5 DOM objects and properties <form> <input type="button" value="Show Author" onclick="alert(document. getElementById('p1').dataset.author);"> </form>
  • 45. 1. The HTML5 <canvas> element is used to draw graphics, on the fly, via scripting (usually JavaScript). 2. The <canvas> element is only a container for graphics, you must use a script to actually draw the graphics. 3. A canvas is a drawable region defined in HTML code with height and width attributes. 4. Canvas has several methods for drawing paths, boxes, circles, characters, and adding images. <canvas id="myCanvas" width="200" height="100"></canvas> Note : The <canvas> element has no drawing abilities of its own. All drawing must be done inside a JavaScript:
  • 46. <!DOCTYPE html> <html> <body> <canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3c3c3;"> Your browser does not support the canvas element. </canvas> <script type="text/javascript“> var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.fillStyle="#FF0000"; ctx.fillRect(0,0,150,75); </script> </body> </html>
  • 47. The HTML5 Geolocation API is used to get the geographical position of a user. Since this can compromise user privacy, the position is not available unless the user approves it. 1. It usages Use the getCurrentPosition() method to get the user's position The getCurrentPosition() Method return following information Property Description coords.latitude The latitude as a decimal number coords.longitude The longitude as a decimal number coords.accuracy The accuracy of position coords.altitude The altitude in meters above the mean sea level coords.altitudeAccuracy The altitude accuracy of position coords.heading The heading as degrees clockwise from North coords.speed The speed in meters per second timestamp The date/time of the response
  • 48. <!DOCTYPE html> <html> <body> <p id="demo">Click the button to get your coordinates:</p> <button onclick="getLocation()">Try It</button> <script> var x=document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else{x.innerHTML="Geolocation is not supported by this browser.";} } function showPosition(position) { x.innerHTML="Latitude: " + position.coords.latitude + "<br />Longitude: " + position.coords.longitude; } </script> </body> </html> http://abkeya.com/blog/2011/02/using-navigator-geolocation-getcurrentposition-to-display- user%E2%80%99s-current-location-on-google-map-and-getting-user-input/
  • 49. 1. With HTML5, web pages can store data locally within the user's browser. 2. Earlier, this was done with cookies. 3. Web Storage is more secure and faster. The data is not included with every server request, but used ONLY when asked for. 4. It is also possible to store large amounts of data, without affecting the website's performance. 5. The data is stored in key/value pairs, and a web page can only access data stored by itself There are two new objects for storing data on the client: 1. localStorage - stores data with no expiration date 2. sessionStorage - stores data for one session
  • 50. 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. <!DOCTYPE html> <html> <body> <div id="result"></div> <script> if(typeof(Storage)!=="undefined") { localStorage.lastname="Smith"; document.getElementById("result").innerHTML="Last name: " + localStorage.lastname; } else { document.getElementById("result").innerHTML="Sorry, your browser does not support web storage..."; } </script> </body> </html>
  • 51. 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
  • 52. <!DOCTYPE html> <html> <head> <script> function clickCounter() { if(typeof(Storage)!=="undefined") { 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."; } else { document.getElementById("result").innerHTML="Sorry, your browser does not support web storage..."; } } </script> </head> <body> <p><button onclick="clickCounter()" type="button">Click me!</button></p> <div id="result"></div> <p>Click the button to see the counter increase.</p> <p>Close the browser tab (or window), and try again, and the counter is reset.</p> </body> </html>
  • 53. 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: 1. Offline browsing - users can use the application when they're offline 2. Speed - cached resources load faster 3. Reduced server load - the browser will only download updated/changed resources from the server
  • 54. 1. To enable application cache, include the manifest attribute in the document's <html> tag: 2. Every page with the manifest attribute specified will be cached when the user visits it. 3. If the manifest attribute is not specified, the page will not be cached (unless the page is specified directly in the manifest file). 4. The recommended file extension for manifest files is: ".appcache” 5. A manifest file needs to be served with the correct MIME-type, which is "text/cache-manifest". Must be configured on the web server.
  • 55. The manifest file is a simple text file, which tells the browser what to cache. The manifest file has three sections: 1. CACHE MANIFEST - Files listed under this header will be cached after they are downloaded for the first time 2. NETWORK - Files listed under this header require a connection to the server, and will never be cached 3. FALLBACK - Files listed under this header specifies fallback pages if a page is inaccessible abc.appcache CACHE MANIFEST <!DOCTYPE html> # 2012-02-21 v1.0.0 <html lang="en" manifest="/abc.appcache"> /theme.css /logo.gif // your html document /main.js </html> NETWORK: login.asp FALLBACK: /html5/ /offline.html
  • 56. Cache Expires on any of the following cases. 1. The user clears the browser's cache 2. The manifest file is modified (see tip below) 3. The application cache is programmatically updated
  • 57. HTML5 Replacement of Flash http://www.techrepublic.com/blog/webmaster/how-to-replace-flash-and-silverlight- with-html5/995 HTML5 for Mobile http://www.engineyard.com/blog/2011/mobile-development-with-html5/ http://www.mobilehtml5.com/ HTML5 for Storage http://diveintohtml5.info/storage.html http://php-html.net/tutorials/html5-local-storage-guide/ HTML Cache http://html5doctor.com/go-offline-with-application-cache/