SlideShare uma empresa Scribd logo
1 de 40
…for the future Web
Content

PART I – Introdution to HTML5
PART II – New Features
PART III - References
Part I - Introduction to HTML5
•   Introduction to HTML5
•   Rules for HTML5
•   Upgrading to HTML5
•   HTML5 – Overview to new features
•   Browser Support for HTML5
•   New Elements in HTML5
Introduction to HTML5
Rules for HTML5
• New features should be based on HTML, CSS, DOM,
  and JavaScript
• Reduce the need for external plugins (like Flash)
• More markup to replace scripting
• HTML5 should be device independent
• The development process should be visible to the
  public
Upgrading to HTML5
• Just <!DOCTYPE html>
HTML5 – Overview to new features
Browser Support for HTML5
• HTML5 is not yet an official standard, and no
  browsers have full HTML5 support.
• But all major browsers (Safari, Chrome, Firefox,
  Opera, Internet Explorer) continue to add new
  HTML5 features to their latest versions.
New Elements in HTML5
New Elements in HTML5
New Elements in HTML5 (cont.)
New Elements in HTML5 (cont.)
• New Semantic/Structural Elements
  Tag            Description
  <article>      Defines an article
  <aside>        Defines content aside from the page content
  <bdi>          Isolates a part of text that might be formatted in a different direction from other 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
  <figure>       Specifies self-contained content, like illustrations, diagrams, photos, code listings, 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 Elements in HTML5 (cont.)
• 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>




• The new <canvas> Element
    Tag          Description

    <canvas>     Used to draw graphics, on the fly, via scripting (usually JavaScript)
New Elements in HTML5 (cont.)
• 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
Removed Elements
•   The following HTML 4.01 elements are removed from HTML5:
•   <acronym>
•   <applet>
•   <basefont>
•   <big>
•   <center>
•   <dir>
•   <font>
•   <frame>
•   <frameset>
•   <noframes>
•   <strike>
•   <tt>
PART II – New Features
•   Video/Audio on the Web
•   HTML5 Drag and Drop
•   HTML5 Canvas
•   HTML5 Inline SVG
•   HTML5 Geolocation
•   HTML5 Web Storage
•   HTML5 Application Cache
•   HTML5 Web Workers
•   HTML Server-Sent Events
•   HTML5 Form Elements
Video/Audio on the Web
• <video>
• <audio>
Video on the Web
• Browsers support:
• HTML5 video demo
• Currently, there are 3 supported video formats for
  the <video> element: MP4, WebM, and Ogg:


   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
HTML5 <video> - Methods, Properties, and
                Events
 Methods       Properties    Events

 play()        currentSrc    play

 pause()       currentTime   pause

 load()        videoWidth    progress

 canPlayType   videoHeight   error

               duration      timeupdate

               ended         ended

               error         abort

               paused        empty

               muted         emptied

               seeking       waiting

               volume        loadedmetadata

               height

               width
Audio on the Web
• Browsers support:
• HTML5 audio
• Currently, there are 3 supported file formats for the
  <audio> element: MP3, Wav, and Ogg:

  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
HTML5 Drag and Drop




• Browsers support:
• Note: Drag and drop does not work in Safari 5.1.2.
• Drag and Drop Demo
• Desktop drag in, drag out (only available in Chrome)
HTML5 Canvas




• Browsers support:
HTML5 Canvas
• Create a Canvas
   – A canvas is specified with the <canvas> element.
   – Specify the id, width, and height of the <canvas> element:
      <canvas id="myCanvas" width="200" height="100"></canvas>
• Draw With JavaScript
   – The <canvas> element has no drawing abilities of its own.
   – All drawing must be done inside a JavaScript:
      <script type="text/javascript">
       var c=document.getElementById("myCanvas");
       var ctx=c.getContext("2d");
       ctx.fillStyle="#FF0000";
       ctx.fillRect(0,0,150,75);
      </script>
• Canvas demo
HTML5 Inline SVG
• SVG stands for Scalable Vector Graphics.
• SVG is used to define vector-based graphics for the
  Web.
• SVG defines the graphics in XML format.
• SVG graphics do NOT lose any quality if they are
  zoomed or resized.
• Every element and every attribute in SVG files can be
  animated
• Browsers support:
• SVG Demo
HTML5 Geolocation




• Browsers Support:
• Note: Geolocation is much more accurate for devices with GPS, like
  iPhone.
• Geolocation demo
HTML5 Web Storage




• Browsers support:
• Note: Internet Explorer 7 and earlier versions, do not support web
   storage.
localStorage

• Example
  localStorage.lastname="Smith";
  document.getElementById("result").innerHTML="Last name: "+localStorage.lastname;

• Local storage demo
sessionStorage

• Example
  sessionStorage.lastname="Smith";
  document.getElementById("result").innerHTML="Last name:
       "+sessionStorage.lastname;

• SessionStorage Demo
HTML5 Application Cache

    – Offline browsing
    – Speed
    – Reduced server load



• Browser Support:
• App cache demo
• Note: Browsers may have different size limits for cached data (some
  browsers have a 5MB limit per site).
Application cache (cont.)
• To enable application cache, include the manifest
  attribute in the document's <html> tag:
     CACHE MANIFEST
     # 2012-02-21 v1.0.0
     /theme.css
     /logo.gif
     /main.js

     NETWORK:
     login.asp

     FALLBACK:
     /html5/ /offline.html
HTML5 Web Workers




• Browsers support:
Web worker (cont.)
• Check Web Worker Support
   if(typeof(Worker)!=="undefined"){
     // Yes! Web worker support!
     } else {
     // Sorry! No Web Worker support..
     }

• Create a Web Worker File
   var i=0;
   function timedCount() {
      i=i+1;
      postMessage(i);
      setTimeout("timedCount()",500);
   }
   timedCount();

• Create a Web Worker Object
   w=new Worker("demo_workers.js");
   w.onmessage=function(event){
   document.getElementById("result").innerHTML=event.data;
   };
• Terminate a Web Worker
   w.terminate();
• Web worker demo
HTML5 Server-Sent Events
• A server-sent event is when a web page
  automatically gets updates from a server.
• This was also possible before, but the web page
  would have to ask if any updates were available.
• Browsers Support:
Server-Sent Events (cont.)
• Receive Server-Sent Event Notifications
          var source=new EventSource("demo_sse.php");
          source.onmessage=function(event){
          document.getElementById("result").innerHTML+=event.data + "<br />";
           };
• Check Server-Sent Events Support
          if(typeof(EventSource)!=="undefined"){
           // Yes! Server-sent events support!
          }else{
          // Sorry! No server-sent events support..
           }
• Server-Side Code
          <?php
          header('Content-Type: text/event-stream');
          header('Cache-Control: no-cache');
          $time = date('r');
          echo "data: The server time is: {$time}nn";
          flush();
          ?>
Note: Output data Always start with "data: “
     Set the "Content-Type" header to "text/event-stream“
• SSE Demo
HTML5 Form Elements
•   <input type="color" name="favcolor" />




•   <input type="date" name="bday" />
HTML5 Form Elements
•   <input type="datetime" name="bdaytime" />




•   <input type="email" name="usremail" />
HTML5 Form Elements
•   <input type="month" name="bdaymonth" />




•   <input type="text" x-webkit-speech />




•   <input type="number" name="quantity" min="1" max="5" />
HTML5 Form Elements
•   <input type="range" name="points" min="1" max="10" />



•   <input type="search" name="googlesearch" />




•   <input type="time" name="usr_time" />



•   <meter value="2" min="0" max="10">2 out of 10</meter>
    <meter value="0.6">60%</meter>
HTML5 Form Elements
•   <progress value="22" max="100"></progress>

•   <input type="url" name="homepage" />




•   <input type="week" name="year_week" />
PART III - References
•   http://slides.html5rocks.com
•   http://w3schools.com/html5
•   http://html5demos.com/
•   http://diveintohtml5.info

Mais conteúdo relacionado

Mais procurados

Android Chromium Rendering Pipeline
Android Chromium Rendering PipelineAndroid Chromium Rendering Pipeline
Android Chromium Rendering Pipeline
Hyungwook Lee
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
Ali Taki
 

Mais procurados (20)

How Browsers Work
How Browsers Work How Browsers Work
How Browsers Work
 
Android chromium web view
Android chromium web viewAndroid chromium web view
Android chromium web view
 
Web component
Web componentWeb component
Web component
 
Asp net
Asp netAsp net
Asp net
 
Share point saturday presentation 9 29-2012-2
Share point saturday presentation 9 29-2012-2Share point saturday presentation 9 29-2012-2
Share point saturday presentation 9 29-2012-2
 
Web 2.0
Web 2.0Web 2.0
Web 2.0
 
Industrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.netIndustrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.net
 
Firefox vs. chrome
Firefox vs. chromeFirefox vs. chrome
Firefox vs. chrome
 
Hardware Acceleration in WebKit
Hardware Acceleration in WebKitHardware Acceleration in WebKit
Hardware Acceleration in WebKit
 
Android Chromium Rendering Pipeline
Android Chromium Rendering PipelineAndroid Chromium Rendering Pipeline
Android Chromium Rendering Pipeline
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
 
Back to the Basics - 1 - Introduction to Web Development
Back to the Basics - 1 - Introduction to Web DevelopmentBack to the Basics - 1 - Introduction to Web Development
Back to the Basics - 1 - Introduction to Web Development
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Asp.net basic
Asp.net basicAsp.net basic
Asp.net basic
 
DotNetNuke
DotNetNukeDotNetNuke
DotNetNuke
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
 
Spsmi13 charts
Spsmi13 chartsSpsmi13 charts
Spsmi13 charts
 
Know, Share, Do - Custom Apps
Know, Share, Do - Custom AppsKnow, Share, Do - Custom Apps
Know, Share, Do - Custom Apps
 
Dot Net Nuke
Dot Net NukeDot Net Nuke
Dot Net Nuke
 

Semelhante a Html 5

HTML5 Presentation
HTML5 PresentationHTML5 Presentation
HTML5 Presentation
vs4vijay
 
WHAT IS HTML5? (at CSS Nite Osaka)
WHAT IS HTML5? (at CSS Nite Osaka)WHAT IS HTML5? (at CSS Nite Osaka)
WHAT IS HTML5? (at CSS Nite Osaka)
Shumpei Shiraishi
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
madhavforu
 
Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!
Gill Cleeren
 
WordCamp Thessaloniki2011 The NextWeb
WordCamp Thessaloniki2011 The NextWebWordCamp Thessaloniki2011 The NextWeb
WordCamp Thessaloniki2011 The NextWeb
George Kanellopoulos
 

Semelhante a Html 5 (20)

HTML5 Presentation
HTML5 PresentationHTML5 Presentation
HTML5 Presentation
 
HTML5 Refresher
HTML5 RefresherHTML5 Refresher
HTML5 Refresher
 
HTML5
HTML5 HTML5
HTML5
 
Html5
Html5Html5
Html5
 
Basics of HTML5 for Phonegap
Basics of HTML5 for PhonegapBasics of HTML5 for Phonegap
Basics of HTML5 for Phonegap
 
WHAT IS HTML5? (at CSS Nite Osaka)
WHAT IS HTML5? (at CSS Nite Osaka)WHAT IS HTML5? (at CSS Nite Osaka)
WHAT IS HTML5? (at CSS Nite Osaka)
 
Html5 shubelal
Html5 shubelalHtml5 shubelal
Html5 shubelal
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
Web Apps
Web AppsWeb Apps
Web Apps
 
Looking into HTML5 + CSS3
Looking into HTML5 + CSS3Looking into HTML5 + CSS3
Looking into HTML5 + CSS3
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
 
Html5
Html5Html5
Html5
 
HTML5: An Introduction To Next Generation Web Development
HTML5: An Introduction To Next Generation Web DevelopmentHTML5: An Introduction To Next Generation Web Development
HTML5: An Introduction To Next Generation Web Development
 
HTML5 and CSS3 refresher
HTML5 and CSS3 refresherHTML5 and CSS3 refresher
HTML5 and CSS3 refresher
 
Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!
 
Html5 n css3
Html5 n css3Html5 n css3
Html5 n css3
 
WordCamp Thessaloniki2011 The NextWeb
WordCamp Thessaloniki2011 The NextWebWordCamp Thessaloniki2011 The NextWeb
WordCamp Thessaloniki2011 The NextWeb
 
Html5 Future of WEB
Html5 Future of WEBHtml5 Future of WEB
Html5 Future of WEB
 
Fundamentals of HTML5
Fundamentals of HTML5Fundamentals of HTML5
Fundamentals of HTML5
 
Rohit&kunjan
Rohit&kunjanRohit&kunjan
Rohit&kunjan
 

Mais de Nguyen Quang (11)

Apache Zookeeper
Apache ZookeeperApache Zookeeper
Apache Zookeeper
 
Apache Storm
Apache StormApache Storm
Apache Storm
 
Deep Reinforcement Learning
Deep Reinforcement LearningDeep Reinforcement Learning
Deep Reinforcement Learning
 
Deep Dialog System Review
Deep Dialog System ReviewDeep Dialog System Review
Deep Dialog System Review
 
Sequence to Sequence Learning with Neural Networks
Sequence to Sequence Learning with Neural NetworksSequence to Sequence Learning with Neural Networks
Sequence to Sequence Learning with Neural Networks
 
Introduction to cassandra
Introduction to cassandraIntroduction to cassandra
Introduction to cassandra
 
X Query for beginner
X Query for beginnerX Query for beginner
X Query for beginner
 
Redistributable introtoscrum
Redistributable introtoscrumRedistributable introtoscrum
Redistributable introtoscrum
 
Text categorization
Text categorizationText categorization
Text categorization
 
A holistic lexicon based approach to opinion mining
A holistic lexicon based approach to opinion miningA holistic lexicon based approach to opinion mining
A holistic lexicon based approach to opinion mining
 
Overview of NoSQL
Overview of NoSQLOverview of NoSQL
Overview of NoSQL
 

Último

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 

Último (20)

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 

Html 5

  • 2. Content PART I – Introdution to HTML5 PART II – New Features PART III - References
  • 3. Part I - Introduction to HTML5 • Introduction to HTML5 • Rules for HTML5 • Upgrading to HTML5 • HTML5 – Overview to new features • Browser Support for HTML5 • New Elements in HTML5
  • 5. Rules for HTML5 • New features should be based on HTML, CSS, DOM, and JavaScript • Reduce the need for external plugins (like Flash) • More markup to replace scripting • HTML5 should be device independent • The development process should be visible to the public
  • 6. Upgrading to HTML5 • Just <!DOCTYPE html>
  • 7. HTML5 – Overview to new features
  • 8. Browser Support for HTML5 • HTML5 is not yet an official standard, and no browsers have full HTML5 support. • But all major browsers (Safari, Chrome, Firefox, Opera, Internet Explorer) continue to add new HTML5 features to their latest versions.
  • 11. New Elements in HTML5 (cont.)
  • 12. New Elements in HTML5 (cont.) • New Semantic/Structural Elements Tag Description <article> Defines an article <aside> Defines content aside from the page content <bdi> Isolates a part of text that might be formatted in a different direction from other 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 <figure> Specifies self-contained content, like illustrations, diagrams, photos, code listings, 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
  • 13. New Elements in HTML5 (cont.) • 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> • The new <canvas> Element Tag Description <canvas> Used to draw graphics, on the fly, via scripting (usually JavaScript)
  • 14. New Elements in HTML5 (cont.) • 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
  • 15. Removed Elements • The following HTML 4.01 elements are removed from HTML5: • <acronym> • <applet> • <basefont> • <big> • <center> • <dir> • <font> • <frame> • <frameset> • <noframes> • <strike> • <tt>
  • 16. PART II – New Features • Video/Audio on the Web • HTML5 Drag and Drop • HTML5 Canvas • HTML5 Inline SVG • HTML5 Geolocation • HTML5 Web Storage • HTML5 Application Cache • HTML5 Web Workers • HTML Server-Sent Events • HTML5 Form Elements
  • 17. Video/Audio on the Web • <video> • <audio>
  • 18. Video on the Web • Browsers support: • HTML5 video demo • Currently, there are 3 supported video formats for the <video> element: MP4, WebM, and Ogg: 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
  • 19. HTML5 <video> - Methods, Properties, and Events Methods Properties Events play() currentSrc play pause() currentTime pause load() videoWidth progress canPlayType videoHeight error duration timeupdate ended ended error abort paused empty muted emptied seeking waiting volume loadedmetadata height width
  • 20. Audio on the Web • Browsers support: • HTML5 audio • Currently, there are 3 supported file formats for the <audio> element: MP3, Wav, and Ogg: 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
  • 21. HTML5 Drag and Drop • Browsers support: • Note: Drag and drop does not work in Safari 5.1.2. • Drag and Drop Demo • Desktop drag in, drag out (only available in Chrome)
  • 23. HTML5 Canvas • Create a Canvas – A canvas is specified with the <canvas> element. – Specify the id, width, and height of the <canvas> element: <canvas id="myCanvas" width="200" height="100"></canvas> • Draw With JavaScript – The <canvas> element has no drawing abilities of its own. – All drawing must be done inside a JavaScript: <script type="text/javascript"> var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.fillStyle="#FF0000"; ctx.fillRect(0,0,150,75); </script> • Canvas demo
  • 24. HTML5 Inline SVG • SVG stands for Scalable Vector Graphics. • SVG is used to define vector-based graphics for the Web. • SVG defines the graphics in XML format. • SVG graphics do NOT lose any quality if they are zoomed or resized. • Every element and every attribute in SVG files can be animated • Browsers support: • SVG Demo
  • 25. HTML5 Geolocation • Browsers Support: • Note: Geolocation is much more accurate for devices with GPS, like iPhone. • Geolocation demo
  • 26. HTML5 Web Storage • Browsers support: • Note: Internet Explorer 7 and earlier versions, do not support web storage.
  • 27. localStorage • Example localStorage.lastname="Smith"; document.getElementById("result").innerHTML="Last name: "+localStorage.lastname; • Local storage demo
  • 28. sessionStorage • Example sessionStorage.lastname="Smith"; document.getElementById("result").innerHTML="Last name: "+sessionStorage.lastname; • SessionStorage Demo
  • 29. HTML5 Application Cache – Offline browsing – Speed – Reduced server load • Browser Support: • App cache demo • Note: Browsers may have different size limits for cached data (some browsers have a 5MB limit per site).
  • 30. Application cache (cont.) • To enable application cache, include the manifest attribute in the document's <html> tag: CACHE MANIFEST # 2012-02-21 v1.0.0 /theme.css /logo.gif /main.js NETWORK: login.asp FALLBACK: /html5/ /offline.html
  • 31. HTML5 Web Workers • Browsers support:
  • 32. Web worker (cont.) • Check Web Worker Support if(typeof(Worker)!=="undefined"){ // Yes! Web worker support! } else { // Sorry! No Web Worker support.. } • Create a Web Worker File var i=0; function timedCount() { i=i+1; postMessage(i); setTimeout("timedCount()",500); } timedCount(); • Create a Web Worker Object w=new Worker("demo_workers.js"); w.onmessage=function(event){ document.getElementById("result").innerHTML=event.data; }; • Terminate a Web Worker w.terminate(); • Web worker demo
  • 33. HTML5 Server-Sent Events • A server-sent event is when a web page automatically gets updates from a server. • This was also possible before, but the web page would have to ask if any updates were available. • Browsers Support:
  • 34. Server-Sent Events (cont.) • Receive Server-Sent Event Notifications var source=new EventSource("demo_sse.php"); source.onmessage=function(event){ document.getElementById("result").innerHTML+=event.data + "<br />"; }; • Check Server-Sent Events Support if(typeof(EventSource)!=="undefined"){ // Yes! Server-sent events support! }else{ // Sorry! No server-sent events support.. } • Server-Side Code <?php header('Content-Type: text/event-stream'); header('Cache-Control: no-cache'); $time = date('r'); echo "data: The server time is: {$time}nn"; flush(); ?> Note: Output data Always start with "data: “ Set the "Content-Type" header to "text/event-stream“ • SSE Demo
  • 35. HTML5 Form Elements • <input type="color" name="favcolor" /> • <input type="date" name="bday" />
  • 36. HTML5 Form Elements • <input type="datetime" name="bdaytime" /> • <input type="email" name="usremail" />
  • 37. HTML5 Form Elements • <input type="month" name="bdaymonth" /> • <input type="text" x-webkit-speech /> • <input type="number" name="quantity" min="1" max="5" />
  • 38. HTML5 Form Elements • <input type="range" name="points" min="1" max="10" /> • <input type="search" name="googlesearch" /> • <input type="time" name="usr_time" /> • <meter value="2" min="0" max="10">2 out of 10</meter> <meter value="0.6">60%</meter>
  • 39. HTML5 Form Elements • <progress value="22" max="100"></progress> • <input type="url" name="homepage" /> • <input type="week" name="year_week" />
  • 40. PART III - References • http://slides.html5rocks.com • http://w3schools.com/html5 • http://html5demos.com/ • http://diveintohtml5.info

Notas do Editor

  1. 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.
  2. “Upgrading” to HTML5 can be as simple as changing your doctype. In HTML5, there is only one doctype: &lt;!DOCTYPE html&gt;Upgrading to the HTML5 doctype won’t break your existing markup, because obsolete elements previously defined in HTML 4 will still render in HTML5. But it will allow you to use — and validate — new semantic elements like &lt;article&gt;, &lt;section&gt;, &lt;header&gt;, and &lt;footer&gt;
  3. The &lt;canvas&gt; element for 2D drawingThe &lt;video&gt; and &lt;audio&gt; elements for media playbackSupport for local storageNew content-specific elements, like &lt;article&gt;, &lt;footer&gt;, &lt;header&gt;, &lt;nav&gt;, &lt;section&gt;New form controls, like calendar, date, time, email, url, search
  4. Until now, there has not been a standard for showing a video/audio 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 tow new elements which specifie a standard way to embed a video/audio on a web page: &lt;video&gt; and &lt;audio&gt; elements.
  5. In traditional HTML standards, drag and drop function must be implemented manually.In HTML5, drag and drop is part of the standard, and any element can be draggable.
  6. The HTML5 &lt;canvas&gt; element is used to draw graphics, on the fly, via scripting (usually JavaScript).The &lt;canvas&gt; element is only a container for graphics, you must use a script to actually draw the graphics.A canvas is a drawable region defined in HTML code with height and width attributes.Canvas has several methods for drawing paths, boxes, circles, characters, and adding images.
  7. 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.
  8. With HTML5, web pages can store data locally within the user&apos;s browser.localStorage - stores data with no expiration datesessionStorage - stores data for one sessionif(typeof(Storage)!==&quot;undefined&quot;)  // Yes! localStorage and sessionStorage support!  // Some code.....  } else  {  // Sorry! No web storage support..  }
  9. The localStorage object stores the data with no expiration date.The data will not be deleted when the browser is closed.
  10. 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.
  11. HTML5 introduces application cache, which means that a web application is cached, and accessible without an internet connection, by creating a cache manifest file.
  12. When executing scripts in an HTML page, the page becomes unresponsive until the script is finished.A web worker is a JavaScript that runs in the background, independently of other scripts, without affecting the performance of the page.
  13. A server-sent event is when a web page automatically gets updates from a server.This was also possible before, but the web page would have to ask if any updates were available. Examples: Facebook/Twitter updates, stock price updates, news feeds, sport results, etc.