SlideShare a Scribd company logo
Usman Saleem | Web Technology Group | i2c Inc. | 2012




                                 HTML 5
                          Introduction | Features | Demo

Tuesday, February 7, 12
TABLE OF CONTENTS

    •   History

    •   HTML5 New Structure Syntax and Semantics

    •   Geolocation in Depth

    •   Web Forms 2.0

    •   Audio and Video

    •   Drag and Drop

    •   Local Storage and Offline Applications


Tuesday, February 7, 12
WHAT IS HTML 5 ?


    • HTML    5 is not a reformulation of previous languages but
        backward compatible with HTML4 and XHTML 1.1

    • Redefinition   of existing markup <elements/> and new
        elements; adding more expression related to semantics

    • HTML5      is a framework ; wraps new technologies and API(s)
        e.g. Audio/Video , GeoLocation, Canvas, WebSockets etc.




Tuesday, February 7, 12
W3C vs WHATWG
                                    W3C Specifications
                                    WHATWG Specifications




                          HISTORY




Tuesday, February 7, 12
HTML 5 HISTORY




HTML 4.0 + Strict Rules = XHTML 1.0
WHATWG - Web Hypertext Application Technology Working Group

Tuesday, February 7, 12
HTML 5 STRUCTURE AND SEMANTICS




Tuesday, February 7, 12
Doctype for HTML   Public Standard        Using HTML 4 version; written in English


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

        changed to           The link points to the file which defines the standard


     <!DOCTYPE HTML >


                                                <meta http-equiv=
                                                “Content-Type content=text/html; charset=UTF-8”>



                                                <meta charset=utf-8 />
                                                <META CHARSET=UTF-8 />
                                                <meta charset=utf-8 />
                                changed to
                                                <meta charset=utf-8>
                                                <meta charset=”utf-8” />
                                                <MeTa CHARset=utF-8>


Tuesday, February 7, 12
HTML 5 BASIC MARKUP

        <!doctype html>               Optional
        <html lang=en>
                           Optional
        <head>                    No Closing tag ; no double quotes surrounding attribute
        <meta charset=utf-8>
        <title>Web Technology Group - Presentations</title>
        </head>
                          Optional
        <body>
          <p>
            Today it was about revolutionary presentational technology HTML 5 future of web
                          No Closing tag; </p>
        </body>

        </html>



       - HTML5 is no more XML Language



Tuesday, February 7, 12
HTML 5 NEW STRUCTURAL ELEMENTS




Tuesday, February 7, 12
<HEADER>
“The header element represents a group of introductory or navigational aids ... Note: A header element is
intended to usually contain the section’s heading (an h1–h6 element or an hgroup element), but this is not
required. The header element can also be used to wrap a section’s table of contents, a search form, or any
relevant logos”



                          <header>
                          <hgroup>
                          <h1>i2c Inc. </h1>        Group of headings
                          <h2>Conceive, Configure, Commit</h2>
                          </hgroup>
                          <nav>
                          <ul>                      Header Navigation
                          <li>Home</li>
                          <li><a href=”products.html”>Our Services</a></li>
                          <li><a href=”contact.html”>Contact Us</a></li>
                          </ul>
                          </nav>
                          </header>




Tuesday, February 7, 12
<NAV>
“The <nav> element is designed to mark up navigation. Navigation is defined as being links around a page
(so, for example, a table of contents at the top of an article that links to anchor points on the same page)
or within a site”


                          <nav>
                                                            Unordered List
                          <ul>
                           <li>Home</li>
                           <li><a href=”products.html”>Our Services</a></li>
                           <li><a href=”contact.html”>Contact Us</a></li>
                          </ul>
                          </nav>
                          <nav>
                          <p><a href=”#”>.. </a></p>        Paragraphs List
                          <p><a href=”#”>.. </a></p>
                          </nav>
                          <nav>
                          <h2>Recent News</h2>              Heading for List
                          <ul>...</ul>
                          </nav>




Tuesday, February 7, 12
<FOOTER>
“The <footer> element is a footer for its nearest ancestor sectioning content or sectioning root element. A
footer typically contains information about its section such as who wrote it, links to related documents,
copyright data, and the like”



                     <footer>
                      <small>&copy;2012 i2c Inc. All rights reserved.</small>
                     </footer>



                     <footer>
                      <nav>
                         <ul> ... </ul>
                     </nav>
                     </footer>




Tuesday, February 7, 12
<ARTICLE>
“The article element represents a component of a page that consists of a self-contained composition in a
document, page, application, or site and that is intended to be independently distributable or reusable, e.g. ,
in syndication”
A blog post, a tutorial, a news story, comic strip, or a video with its transcript all fi t perfectly into this definition.



        <article>

        <header>
        <h1> Listen to HTML 5 Intro. <time datetime=2011-12-12>1 December</time></h1>
        <p>Published on <time datetime=2011-12-8>08 December 2011</time></p>
        </header>

        <p> I am going to talk about HTML5 a brief history and new wrapped technologies and APIs
        within (Venue: Conference Room)
        </p>

        <footer> From Usman Saleem </footer>

        </article>



Tuesday, February 7, 12
<!doctype    html>
      <html>
      <head>
        <title></title>
      </head>
      <body>
        <header>
           <h1></h1>
           <nav>
              <ul>
                <li><a href="#">link 1</a></li>
                <li><a href="#">link 2</a></li>
                <li><a href="#">link 3</a></li>
              </ul>
           </nav>
        </header>

        <section>
          <article>
              <hgroup>
                 <h1>Post title</h1>
                 <h2>Subtitle and info</h2>
              </hgroup>
              <p>Content goes here.</p>
          </article>
          <article>
              <!-- Another article here -->
          </article>
        </section>
        <aside>
          <!-- Sidebar here -->
        </aside>
        <footer></footer>
      </body>
      </html>

Tuesday, February 7, 12
HTML 5 NEW MARKUP




Tuesday, February 7, 12
<ASIDE>
A section of a page that consists of content that is tangentially related to the content around the aside
element, and which could be considered separate from that content. The element can be used for
typographical effects like pull quotes or sidebars, for advertising, for groups of nav elements, and for other
content that is considered separate from the main content of the page.

    <FIGURE>
This element that wraps an image (or a video, or block of code, or a supporting quotation) and its caption,
which goes in the <figcaption> element

  <figure>
  <img src=me.jpg>
  <figcaption>                                                                     <time datetime="2009-11-13">
  Usman Saleem working for i2c Inc              <m>Some Search Text</m>           13<sup>th</sup>November
  <small>Photo &copy; i2c HR Team</small>                                         </time>
  </figcaption>
  </figure>



    <MARK>
The element indicates a part of the document that has been highlighted due to its likely relevance to the
user’s current activity.

    <TIME>
The time element helps browsers and others recognize times in HTML pages.Machine-readable times are
potentially useful for search engines, calendar programs, and the like.
Tuesday, February 7, 12
HTML 5 REDEFINED MARKUP




Tuesday, February 7, 12
<CITE>
A person’s name is not the title of a work— even if people call that person a piece of work— and the
element must therefore not be used to mark up people’s names. Now it must be used for title of work
done by person.
                   In HTML4; <CITE>Amir Wain</CITE> once said, Change is constant.

    <OL>
In HTML 4, the start attribute on <ol> was deprecated, as it was deemed presentational. Luckily, HTML5
reverts this wrong decision. If you want an ordered list to start at five rather than line one, use
                          <ol start=”five” reversed=”true”>...</ol>

    <ADDRESS>
Element is for contact details of the author of the current <article> or document, not as a generic element
for postal addresses

    <EM>,<I>, <STRONG>,<B>
<em> emphasizes and changes the meaning of sentence. <i> is represents the mood of voice. <strong>
adds extra importance to the sentence. <b> adds stylistic value.

    <SMALL>
     It typically features disclaimers, caveats, legal restrictions, or copyrights.


Tuesday, February 7, 12
REMOVED ELEMENTS
The following element are completely obsolete in HTML5, such as <applet> (use <embed> instead),
<big>, <blink>, <center>, <font>, and <marquee>. They will not validate and must not be used by
authors.


    GLOBAL ATTRIBUTES
“The hidden attribute must not be used to hide content that could legitimately be shown in another
presentation. For example, it is incorrect to use hidden to hide panels in a tabbed dialog, because the
tabbed interface is merely a kind of overflow presentation—one could equally well just show all the form
controls in one big page with a scrollbar. It is similarly incorrect to use this attribute to hide content just
from one presentation— if something is marked hidden, it is hidden from all presentations, including, for
instance, screen readers.”

                                   <div id=”secondTab” hidden=”hidden”>


Using a negative integer (by convention, tabindex=”-1”) allows the element to be focused
programmatically, but should not allow the element to be reached using sequential focus navigation.




Tuesday, February 7, 12
GEOLOCATION API




Tuesday, February 7, 12
GEOLOCATION API
   •    Not a part of HTML 5 specification.

   •    Created by W3C, not WHATWG.                                                      API METHODS

                                                                                   •   getCurrentPosition(...)
   •    Invokes asynchronously
                                                                                   •   watchPosition(...)
   •    Uses GPS, IP Address, WiFi to locate
                                                                                   •   clearWatch(...)
   •    Asks for Permission from user




                                                                                   Error: Code
                                           watchPosition
                   navigator.geolocation.getCurrentPosition(successHandler, errorHandler, options)

                                                                                                   MaximumAge: 0
                                                          Position: Coords                         Timeout
                                                           Lat | Long | Accuracy


Tuesday, February 7, 12
HTML 5 TEST SCORES
                            www.html5test.com




Tuesday, February 7, 12
Dec 2011   HTML5 Support
                                               342




Tuesday, February 7, 12
Dec 2011                HTML5 Support
                                                                    342
                 Chrome 15.x
                    Opera 11.x
            Mozilla Firefox 8
             Apple Safari 5.x
        Internet Explorer 9
                Firefox Mobile
                               i0S5
                    Android 2.3
                    Android 4.0
                Opera Mobile
                                      0   100           200   300         400




Tuesday, February 7, 12
Tuesday, February 7, 12
HTML 5 FORMS




Tuesday, February 7, 12
NEW FORM AND ELEMENT ATTRIBUTES
              Name                                                         Description

    autofocus                Specifies a element in form which should receive focus on page load

    autocomplete             Indicate that this element’s value must be remembered for future

    pattern                  Input must match specified regular expression

    placeholder              Example text that appears in textbox until the user types

    novalidate ,             Used on form - indicates that the browser should not validate the form
    formnovalidate
    required                 Indicates that the field value is mandatory


    TEXT SELECTION API
                    Method                                                       Description

    select()                            Existing method for selecting all text in input control

    selectionStart                      Property that sets and gets the selection start point

    selectionEnd                        Property that sets and gets the selection end point

    setSelectionRange(Start,End)        Method that sets the selection start and end point

Tuesday, February 7, 12
NEW INPUT TYPES
               Name                                                        Description
    search                  Indicates a input field used for searching for content
    tel                     Indicates a input field used for containing telephone number
    url                     Indicates a input field used for typing absolute URL Address
    email                   Indicates a input field used for typing valid email address
    number                  Indicates a field that accepts numeric values
    range                   Indicates a input field used for specifying range of values
    time                    Indicates a input field used for specifying time
    date                    Indicates a field that contains date (day,month,year)
    color                   Indicates a field that used to mention color value.



    NEW CSS STYLES
                     Name                                                        Description

    :valid                             Pseudo-class for styling form elements for valid state

    :invalid                           Pseudo-class for styling form elements for invalid state

    :required                          Pseudo-class for styling form elements that are required.

Tuesday, February 7, 12
EXAMPLE - ATTRIBUTES
 <input type=”text” id=”text1” name=”text1” autofocus>

 <input type=”number” id=”AcctNumber” name=”AcctNumber” autocomplete=”off”>

 <input type=”number” id=”text2” name=”zipCode” placeholder=”Like 94650”>

 <input type=”text” id=”text3” name=”expText” pattern=”^[0-9]{5}$”>

 <form method="post" action="" novalidate>

 <input type="submit" name="save" formnovalidate/>

<input type="text" name="emailId" required/>




Tuesday, February 7, 12
EXAMPLE - NEW INPUT TYPES
 <input type=”search” id=”text1” name=”text1”>

 <input type=”email” id=”emailId” name=”emailId” autocomplete=”off ”>

 <input type=”url” id=”text2” name=”urlAddress” >

 <input type=”number” id=”text3” name=”age” min=”18” max=”50” step=”1”>

 <input type="range" name="pay" min=”10” max=”99” step=”1”/>

 <input type=”date” value=”2011-12-22”>

 <input type=”time” value=”01:30”>
                                             Support in Opera only
 <input type=”week” value=”2011-W11”>

 <input type=”month” value=”2011-07”>
                                                                        Browsers with no support
 <input type=”color” >
                                                                         - JQuery UI/Plugins
                                                                         - WebForms JS Library



Tuesday, February 7, 12
AUDIO AND VIDEO




Tuesday, February 7, 12
HTML5 AUDIO AND VIDEO
   •    Going to be primary Audio/Video playback                             Why ?

   •    2007, Opera developers created a video plugin     •   Future of Video/Audio playback
        wrapped within image tag.
                                                          •   Clean code; with fallback strategy
   •    Each browser has its own way of presenting        •   Player is built-in; performance optimized
        <video/> element following standard
                                                          •   iOS devices have no flash support
   •    Audio control built on same element; supporting
        specific formats.




Tuesday, February 7, 12
HTML5 AUDIO AND VIDEO
<video/>
                                                                          Attributes
           <video controls>	

              <source src=”file.mp4” type=”video/mp4”>     •    preload=none|auto|metadata
              <source src=”file.webm” type=”video/webm”>
              <source src=”file.ogg” type=”video/ogg”>     •    autoplay
              <p>Your browser doesnt support video</p>
           </video>                                       •    loop

                                                          •    poster=”poster.jpg”
    <audio/>                                              •    width | height
           <audio src="trailer.oga" controls>	

             <p>Your browser doesnt support audio</p>
           </audio>




                                                              http://www.dailymotion.com/html5
Tuesday, February 7, 12
DRAG AND DROP




Tuesday, February 7, 12
DRAG AND DROP API
                                                                                   How to ?
   •    1999, Microsoft added support in IE5
                                                                 •   Register to draggable events; at least 3
   •    DOM Event based API
                                                                 •   Mention the “dropzone”
   •    Inconsistent implementations by vendors                  •   Apply to all links, text nodes and image
                                                                     elements
   •    Drag elements to external applications e.g. other
        browser window or Photoshop or a text editor


                <img draggable=”true” />
                                                            Browser Support

                          ondragstart
                          ondrop
                          ondragover

                          <div>Drop Zone</div>


Tuesday, February 7, 12
LOCAL STORAGE AND OFFLINE APPS




Tuesday, February 7, 12
HTML 5 STORAGE TYPES
            Web Storage
    •       Local / Session storage also called Web/DOM
            Storage.

    •       Improvement over cookies; like cookies they are
            NOT sent to server. Limit varies from 5MB-10MB

    •       Local storage (like persistent cookie) is persistent;
            Session storage (like session cookies) is transient.

    •       Common Interface; Supported by all browsers.

            Web SQL Storage
        •    Fully relational SQL Interface to SQL Database
             Engine.

        •    Uses embedded SQLLite database engine.

        •    No support for IE and Firefox.
Tuesday, February 7, 12
QCON 2011- PRESENTATIONS
    • HTML                5 Design and Development Tooling

    • Building             Offline Access to Websites

    • High            Performance HTML 5

                                            BOOKS

    • HTML                5 Solutions [Essential Techniques for Developers]

    • Introduction             to HTML 5 [2nd Edition]


Tuesday, February 7, 12

More Related Content

What's hot

Html5 p resentation by techmodi
Html5 p resentation by techmodiHtml5 p resentation by techmodi
Html5 p resentation by techmoditechmodi_India
 
Semantic chop
Semantic chopSemantic chop
Semantic chop
Pascal Rettig
 
Intro to html 5
Intro to html 5Intro to html 5
Intro to html 5
Ian Jasper Mangampo
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtmlsagaroceanic11
 
Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)
Peter Lubbers
 
Html5 Basics
Html5 BasicsHtml5 Basics
Html5 Basics
Pankaj Bajaj
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Gil Fink
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!
Christian Heilmann
 
HTML5 - Introduction
HTML5 - IntroductionHTML5 - Introduction
HTML5 - Introduction
Davy De Pauw
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
Singsys Pte Ltd
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
Alfredo Torre
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
www.netgains.org
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
Vskills
 
HTML Semantic Tags
HTML Semantic TagsHTML Semantic Tags
HTML Semantic Tags
Bruce Kyle
 
Html 5
Html 5Html 5
Html 5 New Features
Html 5 New FeaturesHtml 5 New Features
Html 5 New Features
Ata Ebrahimi
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
IT Geeks
 

What's hot (20)

Html5 p resentation by techmodi
Html5 p resentation by techmodiHtml5 p resentation by techmodi
Html5 p resentation by techmodi
 
Semantic chop
Semantic chopSemantic chop
Semantic chop
 
Intro to html 5
Intro to html 5Intro to html 5
Intro to html 5
 
Basics of css and xhtml
Basics of css and xhtmlBasics of css and xhtml
Basics of css and xhtml
 
Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)
 
Html5 Basics
Html5 BasicsHtml5 Basics
Html5 Basics
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!
 
HTML5 - Introduction
HTML5 - IntroductionHTML5 - Introduction
HTML5 - Introduction
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
Html 5 introduction
Html 5 introductionHtml 5 introduction
Html 5 introduction
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
 
HTML Semantic Tags
HTML Semantic TagsHTML Semantic Tags
HTML Semantic Tags
 
Html 5
Html 5Html 5
Html 5
 
Html 5 New Features
Html 5 New FeaturesHtml 5 New Features
Html 5 New Features
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Html5
Html5Html5
Html5
 

Viewers also liked

HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIs
Remy Sharp
 
Användarguide för Informatörernas Newsdesk
Användarguide för Informatörernas NewsdeskAnvändarguide för Informatörernas Newsdesk
Användarguide för Informatörernas NewsdeskTorkel Kristoffers
 
History of JavaScript
History of JavaScriptHistory of JavaScript
History of JavaScript
Rajat Saxena
 
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM ManipulationJavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
borkweb
 
Javascript intro for MAH
Javascript intro for MAHJavascript intro for MAH
Javascript intro for MAH
Aleksander Fabijan
 
JavaScript History
JavaScript HistoryJavaScript History
JavaScript History
Rhio Kim
 
KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7
phuphax
 
DOM ( Document Object Model )
DOM ( Document Object Model )DOM ( Document Object Model )
DOM ( Document Object Model )ITSTB
 
Introduction to js (cnt.)
Introduction to js (cnt.)Introduction to js (cnt.)
Introduction to js (cnt.)
Aleksander Fabijan
 
Java Script basics and DOM
Java Script basics and DOMJava Script basics and DOM
Java Script basics and DOMSukrit Gupta
 
Dom API In Java Script
Dom API In Java ScriptDom API In Java Script
Dom API In Java ScriptRajat Pandit
 
Javascript and DOM
Javascript and DOMJavascript and DOM
Javascript and DOM
Brian Moschel
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Modelchomas kandar
 
Web Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptWeb Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScript
Edureka!
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
Amit Tyagi
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Bryan Basham
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]
Aaron Gustafson
 
JavaScript - An Introduction
JavaScript - An IntroductionJavaScript - An Introduction
JavaScript - An Introduction
Manvendra Singh
 

Viewers also liked (20)

HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIs
 
Användarguide för Informatörernas Newsdesk
Användarguide för Informatörernas NewsdeskAnvändarguide för Informatörernas Newsdesk
Användarguide för Informatörernas Newsdesk
 
History of JavaScript
History of JavaScriptHistory of JavaScript
History of JavaScript
 
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM ManipulationJavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
 
Javascript intro for MAH
Javascript intro for MAHJavascript intro for MAH
Javascript intro for MAH
 
JavaScript History
JavaScript HistoryJavaScript History
JavaScript History
 
KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7
 
DOM ( Document Object Model )
DOM ( Document Object Model )DOM ( Document Object Model )
DOM ( Document Object Model )
 
Introduction to js (cnt.)
Introduction to js (cnt.)Introduction to js (cnt.)
Introduction to js (cnt.)
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Java Script basics and DOM
Java Script basics and DOMJava Script basics and DOM
Java Script basics and DOM
 
Dom API In Java Script
Dom API In Java ScriptDom API In Java Script
Dom API In Java Script
 
Javascript and DOM
Javascript and DOMJavascript and DOM
Javascript and DOM
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Web Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptWeb Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScript
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]
 
Js ppt
Js pptJs ppt
Js ppt
 
JavaScript - An Introduction
JavaScript - An IntroductionJavaScript - An Introduction
JavaScript - An Introduction
 

Similar to Beginning Html 5 Presentation

Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quidePL dream
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quideAshok Suragala
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quideJerry Wijaya
 
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
Prashanth Krish
 
Html5, a gentle introduction
Html5, a gentle introduction Html5, a gentle introduction
Html5, a gentle introduction
Diego Scataglini
 
Html 5, a gentle introduction
Html 5, a gentle introductionHtml 5, a gentle introduction
Html 5, a gentle introduction
Diego Scataglini
 
HTML5 tags.ppt
HTML5 tags.pptHTML5 tags.ppt
HTML5 tags.ppt
abcxyz1337
 
HTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranHTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranRobert Nyman
 
SW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+DrupalSW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+DrupalJen Simmons
 
46h interaction 1.lesson Hello world
46h interaction 1.lesson Hello world46h interaction 1.lesson Hello world
46h interaction 1.lesson Hello world
hemi46h
 
Html5
Html5Html5
HTML5+CSS3 (入門編)
HTML5+CSS3 (入門編)HTML5+CSS3 (入門編)
HTML5+CSS3 (入門編)
博史 高木
 
Html basics-auro skills
Html basics-auro skillsHtml basics-auro skills
Html basics-auro skills
BoneyGawande
 
Html5 reference-poster
Html5 reference-posterHtml5 reference-poster
Html5 reference-posterJulio Pari
 
5 ways to embrace HTML5 today
5 ways to embrace HTML5 today5 ways to embrace HTML5 today
5 ways to embrace HTML5 today
Daniel Ryan
 
Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateInventis Web Architects
 
Html5
Html5Html5
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential Training
Kaloyan Kosev
 
HTML5 & Front-end overview
HTML5 & Front-end overviewHTML5 & Front-end overview
HTML5 & Front-end overviewAshish Mukherjee
 

Similar to Beginning Html 5 Presentation (20)

Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quide
 
Html5 quick learning guide
Html5 quick learning guideHtml5 quick learning guide
Html5 quick learning guide
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quide
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quide
 
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
 
Html5, a gentle introduction
Html5, a gentle introduction Html5, a gentle introduction
Html5, a gentle introduction
 
Html 5, a gentle introduction
Html 5, a gentle introductionHtml 5, a gentle introduction
Html 5, a gentle introduction
 
HTML5 tags.ppt
HTML5 tags.pptHTML5 tags.ppt
HTML5 tags.ppt
 
HTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranHTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - Altran
 
SW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+DrupalSW Drupal Summit: HTML5+Drupal
SW Drupal Summit: HTML5+Drupal
 
46h interaction 1.lesson Hello world
46h interaction 1.lesson Hello world46h interaction 1.lesson Hello world
46h interaction 1.lesson Hello world
 
Html5
Html5Html5
Html5
 
HTML5+CSS3 (入門編)
HTML5+CSS3 (入門編)HTML5+CSS3 (入門編)
HTML5+CSS3 (入門編)
 
Html basics-auro skills
Html basics-auro skillsHtml basics-auro skills
Html basics-auro skills
 
Html5 reference-poster
Html5 reference-posterHtml5 reference-poster
Html5 reference-poster
 
5 ways to embrace HTML5 today
5 ways to embrace HTML5 today5 ways to embrace HTML5 today
5 ways to embrace HTML5 today
 
Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-template
 
Html5
Html5Html5
Html5
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential Training
 
HTML5 & Front-end overview
HTML5 & Front-end overviewHTML5 & Front-end overview
HTML5 & Front-end overview
 

Beginning Html 5 Presentation

  • 1. Usman Saleem | Web Technology Group | i2c Inc. | 2012 HTML 5 Introduction | Features | Demo Tuesday, February 7, 12
  • 2. TABLE OF CONTENTS • History • HTML5 New Structure Syntax and Semantics • Geolocation in Depth • Web Forms 2.0 • Audio and Video • Drag and Drop • Local Storage and Offline Applications Tuesday, February 7, 12
  • 3. WHAT IS HTML 5 ? • HTML 5 is not a reformulation of previous languages but backward compatible with HTML4 and XHTML 1.1 • Redefinition of existing markup <elements/> and new elements; adding more expression related to semantics • HTML5 is a framework ; wraps new technologies and API(s) e.g. Audio/Video , GeoLocation, Canvas, WebSockets etc. Tuesday, February 7, 12
  • 4. W3C vs WHATWG W3C Specifications WHATWG Specifications HISTORY Tuesday, February 7, 12
  • 5. HTML 5 HISTORY HTML 4.0 + Strict Rules = XHTML 1.0 WHATWG - Web Hypertext Application Technology Working Group Tuesday, February 7, 12
  • 6. HTML 5 STRUCTURE AND SEMANTICS Tuesday, February 7, 12
  • 7. Doctype for HTML Public Standard Using HTML 4 version; written in English <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd|transitional|strict.dtd"> changed to The link points to the file which defines the standard <!DOCTYPE HTML > <meta http-equiv= “Content-Type content=text/html; charset=UTF-8”> <meta charset=utf-8 /> <META CHARSET=UTF-8 /> <meta charset=utf-8 /> changed to <meta charset=utf-8> <meta charset=”utf-8” /> <MeTa CHARset=utF-8> Tuesday, February 7, 12
  • 8. HTML 5 BASIC MARKUP <!doctype html> Optional <html lang=en> Optional <head> No Closing tag ; no double quotes surrounding attribute <meta charset=utf-8> <title>Web Technology Group - Presentations</title> </head> Optional <body> <p> Today it was about revolutionary presentational technology HTML 5 future of web No Closing tag; </p> </body> </html> - HTML5 is no more XML Language Tuesday, February 7, 12
  • 9. HTML 5 NEW STRUCTURAL ELEMENTS Tuesday, February 7, 12
  • 10. <HEADER> “The header element represents a group of introductory or navigational aids ... Note: A header element is intended to usually contain the section’s heading (an h1–h6 element or an hgroup element), but this is not required. The header element can also be used to wrap a section’s table of contents, a search form, or any relevant logos” <header> <hgroup> <h1>i2c Inc. </h1> Group of headings <h2>Conceive, Configure, Commit</h2> </hgroup> <nav> <ul> Header Navigation <li>Home</li> <li><a href=”products.html”>Our Services</a></li> <li><a href=”contact.html”>Contact Us</a></li> </ul> </nav> </header> Tuesday, February 7, 12
  • 11. <NAV> “The <nav> element is designed to mark up navigation. Navigation is defined as being links around a page (so, for example, a table of contents at the top of an article that links to anchor points on the same page) or within a site” <nav> Unordered List <ul> <li>Home</li> <li><a href=”products.html”>Our Services</a></li> <li><a href=”contact.html”>Contact Us</a></li> </ul> </nav> <nav> <p><a href=”#”>.. </a></p> Paragraphs List <p><a href=”#”>.. </a></p> </nav> <nav> <h2>Recent News</h2> Heading for List <ul>...</ul> </nav> Tuesday, February 7, 12
  • 12. <FOOTER> “The <footer> element is a footer for its nearest ancestor sectioning content or sectioning root element. A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like” <footer> <small>&copy;2012 i2c Inc. All rights reserved.</small> </footer> <footer> <nav> <ul> ... </ul> </nav> </footer> Tuesday, February 7, 12
  • 13. <ARTICLE> “The article element represents a component of a page that consists of a self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable, e.g. , in syndication” A blog post, a tutorial, a news story, comic strip, or a video with its transcript all fi t perfectly into this definition. <article> <header> <h1> Listen to HTML 5 Intro. <time datetime=2011-12-12>1 December</time></h1> <p>Published on <time datetime=2011-12-8>08 December 2011</time></p> </header> <p> I am going to talk about HTML5 a brief history and new wrapped technologies and APIs within (Venue: Conference Room) </p> <footer> From Usman Saleem </footer> </article> Tuesday, February 7, 12
  • 14. <!doctype html> <html> <head> <title></title> </head> <body> <header> <h1></h1> <nav> <ul> <li><a href="#">link 1</a></li> <li><a href="#">link 2</a></li> <li><a href="#">link 3</a></li> </ul> </nav> </header> <section> <article> <hgroup> <h1>Post title</h1> <h2>Subtitle and info</h2> </hgroup> <p>Content goes here.</p> </article> <article> <!-- Another article here --> </article> </section> <aside> <!-- Sidebar here --> </aside> <footer></footer> </body> </html> Tuesday, February 7, 12
  • 15. HTML 5 NEW MARKUP Tuesday, February 7, 12
  • 16. <ASIDE> A section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content. The element can be used for typographical effects like pull quotes or sidebars, for advertising, for groups of nav elements, and for other content that is considered separate from the main content of the page. <FIGURE> This element that wraps an image (or a video, or block of code, or a supporting quotation) and its caption, which goes in the <figcaption> element <figure> <img src=me.jpg> <figcaption> <time datetime="2009-11-13"> Usman Saleem working for i2c Inc <m>Some Search Text</m> 13<sup>th</sup>November <small>Photo &copy; i2c HR Team</small> </time> </figcaption> </figure> <MARK> The element indicates a part of the document that has been highlighted due to its likely relevance to the user’s current activity. <TIME> The time element helps browsers and others recognize times in HTML pages.Machine-readable times are potentially useful for search engines, calendar programs, and the like. Tuesday, February 7, 12
  • 17. HTML 5 REDEFINED MARKUP Tuesday, February 7, 12
  • 18. <CITE> A person’s name is not the title of a work— even if people call that person a piece of work— and the element must therefore not be used to mark up people’s names. Now it must be used for title of work done by person. In HTML4; <CITE>Amir Wain</CITE> once said, Change is constant. <OL> In HTML 4, the start attribute on <ol> was deprecated, as it was deemed presentational. Luckily, HTML5 reverts this wrong decision. If you want an ordered list to start at five rather than line one, use <ol start=”five” reversed=”true”>...</ol> <ADDRESS> Element is for contact details of the author of the current <article> or document, not as a generic element for postal addresses <EM>,<I>, <STRONG>,<B> <em> emphasizes and changes the meaning of sentence. <i> is represents the mood of voice. <strong> adds extra importance to the sentence. <b> adds stylistic value. <SMALL> It typically features disclaimers, caveats, legal restrictions, or copyrights. Tuesday, February 7, 12
  • 19. REMOVED ELEMENTS The following element are completely obsolete in HTML5, such as <applet> (use <embed> instead), <big>, <blink>, <center>, <font>, and <marquee>. They will not validate and must not be used by authors. GLOBAL ATTRIBUTES “The hidden attribute must not be used to hide content that could legitimately be shown in another presentation. For example, it is incorrect to use hidden to hide panels in a tabbed dialog, because the tabbed interface is merely a kind of overflow presentation—one could equally well just show all the form controls in one big page with a scrollbar. It is similarly incorrect to use this attribute to hide content just from one presentation— if something is marked hidden, it is hidden from all presentations, including, for instance, screen readers.” <div id=”secondTab” hidden=”hidden”> Using a negative integer (by convention, tabindex=”-1”) allows the element to be focused programmatically, but should not allow the element to be reached using sequential focus navigation. Tuesday, February 7, 12
  • 21. GEOLOCATION API • Not a part of HTML 5 specification. • Created by W3C, not WHATWG. API METHODS • getCurrentPosition(...) • Invokes asynchronously • watchPosition(...) • Uses GPS, IP Address, WiFi to locate • clearWatch(...) • Asks for Permission from user Error: Code watchPosition navigator.geolocation.getCurrentPosition(successHandler, errorHandler, options) MaximumAge: 0 Position: Coords Timeout Lat | Long | Accuracy Tuesday, February 7, 12
  • 22. HTML 5 TEST SCORES www.html5test.com Tuesday, February 7, 12
  • 23. Dec 2011 HTML5 Support 342 Tuesday, February 7, 12
  • 24. Dec 2011 HTML5 Support 342 Chrome 15.x Opera 11.x Mozilla Firefox 8 Apple Safari 5.x Internet Explorer 9 Firefox Mobile i0S5 Android 2.3 Android 4.0 Opera Mobile 0 100 200 300 400 Tuesday, February 7, 12
  • 26. HTML 5 FORMS Tuesday, February 7, 12
  • 27. NEW FORM AND ELEMENT ATTRIBUTES Name Description autofocus Specifies a element in form which should receive focus on page load autocomplete Indicate that this element’s value must be remembered for future pattern Input must match specified regular expression placeholder Example text that appears in textbox until the user types novalidate , Used on form - indicates that the browser should not validate the form formnovalidate required Indicates that the field value is mandatory TEXT SELECTION API Method Description select() Existing method for selecting all text in input control selectionStart Property that sets and gets the selection start point selectionEnd Property that sets and gets the selection end point setSelectionRange(Start,End) Method that sets the selection start and end point Tuesday, February 7, 12
  • 28. NEW INPUT TYPES Name Description search Indicates a input field used for searching for content tel Indicates a input field used for containing telephone number url Indicates a input field used for typing absolute URL Address email Indicates a input field used for typing valid email address number Indicates a field that accepts numeric values range Indicates a input field used for specifying range of values time Indicates a input field used for specifying time date Indicates a field that contains date (day,month,year) color Indicates a field that used to mention color value. NEW CSS STYLES Name Description :valid Pseudo-class for styling form elements for valid state :invalid Pseudo-class for styling form elements for invalid state :required Pseudo-class for styling form elements that are required. Tuesday, February 7, 12
  • 29. EXAMPLE - ATTRIBUTES <input type=”text” id=”text1” name=”text1” autofocus> <input type=”number” id=”AcctNumber” name=”AcctNumber” autocomplete=”off”> <input type=”number” id=”text2” name=”zipCode” placeholder=”Like 94650”> <input type=”text” id=”text3” name=”expText” pattern=”^[0-9]{5}$”> <form method="post" action="" novalidate> <input type="submit" name="save" formnovalidate/> <input type="text" name="emailId" required/> Tuesday, February 7, 12
  • 30. EXAMPLE - NEW INPUT TYPES <input type=”search” id=”text1” name=”text1”> <input type=”email” id=”emailId” name=”emailId” autocomplete=”off ”> <input type=”url” id=”text2” name=”urlAddress” > <input type=”number” id=”text3” name=”age” min=”18” max=”50” step=”1”> <input type="range" name="pay" min=”10” max=”99” step=”1”/> <input type=”date” value=”2011-12-22”> <input type=”time” value=”01:30”> Support in Opera only <input type=”week” value=”2011-W11”> <input type=”month” value=”2011-07”> Browsers with no support <input type=”color” > - JQuery UI/Plugins - WebForms JS Library Tuesday, February 7, 12
  • 31. AUDIO AND VIDEO Tuesday, February 7, 12
  • 32. HTML5 AUDIO AND VIDEO • Going to be primary Audio/Video playback Why ? • 2007, Opera developers created a video plugin • Future of Video/Audio playback wrapped within image tag. • Clean code; with fallback strategy • Each browser has its own way of presenting • Player is built-in; performance optimized <video/> element following standard • iOS devices have no flash support • Audio control built on same element; supporting specific formats. Tuesday, February 7, 12
  • 33. HTML5 AUDIO AND VIDEO <video/> Attributes <video controls> <source src=”file.mp4” type=”video/mp4”> • preload=none|auto|metadata <source src=”file.webm” type=”video/webm”> <source src=”file.ogg” type=”video/ogg”> • autoplay <p>Your browser doesnt support video</p> </video> • loop • poster=”poster.jpg” <audio/> • width | height <audio src="trailer.oga" controls> <p>Your browser doesnt support audio</p> </audio> http://www.dailymotion.com/html5 Tuesday, February 7, 12
  • 34. DRAG AND DROP Tuesday, February 7, 12
  • 35. DRAG AND DROP API How to ? • 1999, Microsoft added support in IE5 • Register to draggable events; at least 3 • DOM Event based API • Mention the “dropzone” • Inconsistent implementations by vendors • Apply to all links, text nodes and image elements • Drag elements to external applications e.g. other browser window or Photoshop or a text editor <img draggable=”true” /> Browser Support ondragstart ondrop ondragover <div>Drop Zone</div> Tuesday, February 7, 12
  • 36. LOCAL STORAGE AND OFFLINE APPS Tuesday, February 7, 12
  • 37. HTML 5 STORAGE TYPES Web Storage • Local / Session storage also called Web/DOM Storage. • Improvement over cookies; like cookies they are NOT sent to server. Limit varies from 5MB-10MB • Local storage (like persistent cookie) is persistent; Session storage (like session cookies) is transient. • Common Interface; Supported by all browsers. Web SQL Storage • Fully relational SQL Interface to SQL Database Engine. • Uses embedded SQLLite database engine. • No support for IE and Firefox. Tuesday, February 7, 12
  • 38. QCON 2011- PRESENTATIONS • HTML 5 Design and Development Tooling • Building Offline Access to Websites • High Performance HTML 5 BOOKS • HTML 5 Solutions [Essential Techniques for Developers] • Introduction to HTML 5 [2nd Edition] Tuesday, February 7, 12