Presentation is loading. Please wait.

Presentation is loading. Please wait.

1. History, Vision & Future of HTML5 1.1 What Is HTML5? Successor of HTML 4.01 and XHTML 1.1 It comes with new tags, features and APIs Below is a non exhaustive.

Similar presentations


Presentation on theme: "1. History, Vision & Future of HTML5 1.1 What Is HTML5? Successor of HTML 4.01 and XHTML 1.1 It comes with new tags, features and APIs Below is a non exhaustive."— Presentation transcript:

1 1. History, Vision & Future of HTML5 1.1 What Is HTML5? Successor of HTML 4.01 and XHTML 1.1 It comes with new tags, features and APIs Below is a non exhaustive list of features that tend to be labelled as "HTML5" in the medias: New structural elements (,, and more) Forms 2.0 and client-side validation Native browser support for audio and video (, ) Canvas API and SVG Web storage Offline applications Geolocation Drag & Drop Web Workers New communications API (Server Sent Events, Web Sockets, …)

2 1. History, Vision & Future of HTML5 1.2 History of HTML5? December 1997: HTML 4.0 is published by the W3C February - March 1998: XML 1.0 is published December 1999 - January 2000: ECMAScript 3rd Edition, XHTML 1.0 (Basically HTML tags reformulated in XML) and, HTML 4.01 recommendations are published May 2001: XHTML 1.1 recommendation is published August 2002: XHTML 2.0 first working draft is released. December 2002: XHTML 2.0 second working draft published. January 2008: First W3C working draft of HTML5 is published!!

3 1. History, Vision & Future of HTML5 1.3 Future of HTML5 84% of Developers Plan to Adopt Key HTML5 Features The key to understanding HTML5 is that it is not one, but a group of technologies. Within HTML5, developers have a tremendous amount of choice regarding what they use and what they don’t use The power of HTML5 being ready for prime-time can be seen in Microsoft’s choice to utilize it in Windows 8 Still on the fence with adopting HTML5 in your next project?

4 2. Getting started with HTML5 Wondering what it takes to get it started? Any Text editor such as Notepad++, Editplus, Textmate, Dream weaver Modern browsers such as Firefox 3.5 +, IE9, chrome, safari Prior knowledge of HTML 4

5 3. Structure of Web page 3.1. New and Updated HTML5 Elements HTML5 introduces 28 new elements:,,,,,,,,,,,,,,,,,,,,,,,,,, and An HTML page first starts with the DOCTYPE declaration HTML5 also update some of the previous existing elements to better reflect how they are used on the Web or to make them more useful such as: The element can now also contain flow content instead of just phrasing content The element is now representing a paragraph-level thematic break The element only represent the title of a work The element is now representing importance rather than strong emphasis

6 3. Structure of Web page 3.2. First HTML5 webpage Title of the document That’s all I need to create my first HTML5 page Output: Click hereClick here

7 3. Structure of Web page 3.3. New Semantic Elements : Represents a major navigation block. It groups links to other pages or to parts of the current page. does not have to be used in every place you can find links. For instance, footers often contains links to terms of service, copyright page and such, the element would be sufficient in that case

8 3. Structure of Web page 3.3. New Semantic Elements : tag specifies a header for a document or section. However, we mustn't think that "header" is only for masthead of a website. "header" can be use as a heading of an blog entry or news article as every article has its title and published date and time

9 3. Structure of Web page 3.3. New Semantic Elements : The web today contains a ocean of news articles and blog entries. That gives W3C a good reason to define an element for article instead of. We should use article for content that we think it can be distributable. Just like news or blog entry can we can share in RSS feed "article" element can be nested in another "article" element. An article element doesn't just mean article content. You can have header andfooter element in an article. In fact, it is very common to have header as each article should have a title.headerfooterheader

10 3. Structure of Web page 3.3. New Semantic Elements : The "aside" element is a section that somehow related to main content, but it can be separate from that content

11 3. Structure of Web page 3.3. New Semantic Elements : Similarly to "header" element, "footer" element is often referred to the footer of a web page. Well, most of the time, footer can be used as what we thought. Please don't think you can only have one footer per web document, you can have a footer in every section, or every article.

12 3. Structure of Web page 3.3. New Semantic Elements : The new "progress" element appears to be very similar to the "meter" element. It is created to indicate progress of a specific task.meter The progress can be either determinate OR interderminate. Which means, you can use "progress" element to indicate a progress that you do not even know how much more work is to be done yet. Progress of Task A : 60%

13 3. Structure of Web page 3.3. New Semantic Elements : "Meter" is a new element in HTML5 which represenet value of a known range as a gauge. The keyword here is "known range". That means, you are only allowed to use it when you are clearly aware of its minimum value and maximum value. One example is score of rating. I would rate this movie 8 of 10.

14 3. Structure of Web page 3.3. New Semantic Elements : The mark element represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context. Basically, it is used to bring the reader's attention to a part of the text that might not have been

15 3. Structure of Web page 3.3. New Semantic Elements : The tag specifies self-contained content, like illustrations, diagrams, photos, code listings, etc. While the content of the element is related to the main flow, its position is independent of the main flow, and if removed it should not affect the flow of the document

16 3. Structure of Web page 3.3. Lets put altogether

17 3. Structure of Web page 3.3. Designing blog with html5 IE layout There’s one gotcha about styling HTML 5 pages in IE: it doesn’t work. You can force it to quite easily with a JavaScript hack document.createElement('element name'). HTML 5 enabling scriptHTML 5 enabling script which I use in the header to conjure all the missing elements into existence all at once.

18 3. Structure of Web page 3.3. why so much fuss for semantics in html5 Well, they add semantics to the page. The browser now knows which area of your site is the header or the footer because there are header and footer elements, whereas div might be called “branding The first is for search engine use; it’s easy to imagine Messrs Google or Yahoo! giving lower weighting to content in footer elements, or extra weight to content in the header. site navigable for people with disabilities. People with learning difficulties might instruct their browser always to put the articles before the navigation

19 Form Attributs

20 HTML5 has several new elements and attributes for forms. New form attributes : autocomplete novalidate New input attributes : autocomplete autofocus form form overrides (formaction, formenctype, formmethod, formnovalidate, formtarget) height and width list min, max and step multiple pattern (regexp) placeholder required New Form Attributes

21 Browser support for the new input type : Browser Support Input TypeIEFirefoxOperaChromeSafari autocomplete8.03.59.53.04.0 autofocusNo4.010.03.04.0 formNo4.09.510.0No form overridesNo4.010.510.0No height and width8.03.5 9.53.04.0 listNo4.09.5No min, max and stepNo 9.53.0No multipleNo3.511.03.04.0 novalidateNo4.011.010.0No patternNo4.09.53.0No placeholderNo4.011.03.0 requiredNo4.09.53.0No

22 The autocomplete attribute specifies that the form or input field should have an autocomplete function. Note: The autocomplete attribute works with, and the following types: text, search, url, telephone, email, password, datepickers, range, and color. When the user starts to type in an autocomplete field, the browser should display options to fill in the field : First name: Last name: E-mail: In some browsers you may need to activate the autocomplete function for this to work. autocomplete Attribute

23 The autofocus attribute specifies that a field should automatically get focus when a page is loaded. Note: The autofocus attribute works with all types. User name: autofocus Attribute

24 The form attribute specifies one or more forms the input field belongs to. Note: The form attribute works with all types. To refer to more than one form, use a space-separated list. The form attribute must refer to the id of the form it belongs to: First name: Last name: form Attribute

25 The form override attributes allow you to override some of the attributes set for the form element. The form override attributes are : formaction - Overrides the form action attribute formenctype - Overrides the form enctype attribute formmethod - Overrides the form method attribute formnovalidate - Overrides the form novalidate attribute formtarget - Overrides the form target attribute Note: The form override attributes works with the following types: submit and image. Form Override Attribute

26 Example : E-mail: These attributes are helpful for creating different submit buttons. Form Override Attribute

27 The height and width attributes specifies the height and width of the image used for the input type image. The height and width attributes only works with type: image. height and width Attribute

28 The list attribute specifies a datalist for an input field. A datalist is a list of options for an input field. The list attribute works with the following types : text, search, url, telephone, email, date pickers, number, range, and color. Webpage: list Attribute

29 The min, max and step attributes are used to specify restrictions for input types containing numbers or dates. The max attribute specifies the maximum value allowed for the input field. The min attribute specifies the minimum value allowed for the input field. The step attribute specifies the legal number intervals for the input field (if step="3", legal numbers could be - 3,0,3,6, etc). min, max and step Attribute

30 The min, max, and step attributes works with the following types: date pickers, number, and range. The example below shows a numeric field that accepts values between 0 and 10, with a step of 3 (legal numbers are 0, 3, 6 and 9): Points: min, max and step Attribute

31 The multiple attribute specifies that multiple values can be selected for an input field. The multiple attribute works with the following types: email, and file. Example : Select images: multipleAttribute multiple Attribute

32 The novalidate attribute specifies that the form or input field should not be validated when submitted. If this attribute is present the form will not validate form input. The novalidate attribute works with: and the following types: text, search, url, telephone, email, password, date pickers, range, and color. Example : E-mail: novalidate Attribute

33 The pattern attribute specifies a pattern used to validate an input field. The pattern is a regular expression. The pattern attribute works with the following types: text, search, url, telephone, email, and password The example below shows a text field that can only contain three letters (no numbers or special characters) : Country code: pattern Attribute

34 The placeholder attribute provides a hint that describes the expected value of an input field. The placeholder attribute works with the following types: text, search, url, telephone, email, and password The hint is displayed in the input field when it is empty, and disappears when the field gets focus. Example : placeholderAttribute placeholder Attribute

35 The required attribute specifies that an input field must be filled out before submitting. The required attribute works with the following types: text, search, url, telephone, email, password, date pickers, number, checkbox, radio, and file. Example : Name: required Attribute

36 Input Type

37 HTML5 has several new input types for forms. These new features allow for better input control and validation. New input types : email url number range Date pickers (date, month, week, time, datetime, datetime-local) search color New Input Type

38 Browser support for the new input type : Browser Support Input TypeIEFirefoxOperaChromeSafari emailNo4.09.010.0No urlNo4.09.010.0No numberNo 9.07.0No rangeNo 9.04.0 Date pickersNo 9.010.0No searchNo4.011.010.0No colorNo 11.0No

39 The email type is used for input fields that should contain an e-mail address. The value of the email field is automatically validated when the form is submitted. Basic syntax : E-mail: Input Type - email

40 The url type is used for input fields that should contain a URL address. The value of the url field is automatically validated when the form is submitted. Basic syntax : Homepage: Input Type - url

41 The number type is used for input fields that should contain a numeric value. You can also set restrictions on what numbers are accepted Example : Points: Input Type - number

42 Use the following attributes to specify restrictions for the number type: Input Type - number AttributeValueDescription maxnumberSpecifies the maximum value allowed minnumberSpecifies the minimum value allowed stepnumber Specifies legal number intervals (if step="3", legal numbers could be -3,0,3,6, etc) valuenumberSpecifies the default value

43 The range type is used for input fields that should contain a value from a range of numbers. The range type is displayed as a slider bar. You can also set restrictions on what numbers are accepted Example: Input Type - range

44 Use the following attributes to specify restrictions for the range type: Input Type - range AttributeValueDescription maxnumberSpecifies the maximum value allowed minnumberSpecifies the minimum value allowed stepnumber Specifies legal number intervals (if step="3", legal numbers could be -3,0,3,6, etc) valuenumberSpecifies the default value

45 HTML5 has several new input types for selecting date and time: date - Selects date, month and year month - Selects month and year week - Selects week and year time - Selects time (hour and minute) datetime - Selects time, date, month and year (UTC time) datetime-local - Selects time, date, month and year (local time) Example: Date: Input Type – Date Pickers

46 The search type is used for search fields, like a site search, or Google search. The search field behaves like a regular text field. Input Type – search

47 The color type is used for input fields that should contain a color. This input type will allow you to select a color from a color picker : Color: Input Type – color

48 Audio

49 The HTML 5.0 specification allows us playing sound using the element. The element can play sound files or an audio stream. The HTML 5.0 specification aims at supporting the following sounds formats: MP3, WAV and Ogg Vorbis. Audio

50 Until now, there has never been a standard for playing audio on a web page. Today, most audio are played through a plugin (like flash). However, not all browsers have the same plugins. Currently, there are 3 supported audio formats for the audio element: Format FormatFirefox 3.5Opera 10.5Chrome 3.0IE 9Safari 3.0 Ogg VorbisYes No MP3No Yes WavYes No Yes

51 Basic Syntax to Embed Video : *Content we place in between the tags will be displayed when the browser doesn't support playing audio The control attribute is for adding the play, pause and volume controls Basic Syntax

52 The audio element allows multiple source elements. Source elements can link to different audio files. We can add the child elements in between the audio element tags. The browser will use the first supported format. browser does not support html 5.0 Basic Syntax

53 The HTML 5.0 supports the following attributes : Attribute AttributeValueDescription autoplay Specifies that the audio will start playing as soon as it is ready. controls Specifies that controls will be displayed, such as a play button. loop Specifies that the audio will start playing again (looping) when it reaches the end preload Specifies that the audio will be loaded at page load, and ready to run. Ignored if autoplay is present. srcurl Specifies the URL of the audio to play

54 Video

55 HTML 5.0 provides a standard for showing video. Using the element we can easily embed video within our web page. The video formats the element supports include the following : MPG4 (with H.264 video codec and AAC audio codec) OGG (with Thedora video codec and Vorbis audio codec) Video

56 Until now, there has never been a standard for showing video on a web page. Today, most videos are shown through a plugin (like flash). However, not all browsers have the same plugins. HTML5 specifies a standard way to include video, with the video element. Currently, there are 2 supported video formats for the video element: Format FormatFirefox 3.5Opera 10.5Chrome 3.0IE 8Safari 3.0 OggYes No MPEG 4No YesNoYes

57 Basic Syntax to Embed Video : *Content we place in between the tags will be displayed when the browser doesn't support displaying video We can use the width and height attributes in order to specify the size The control attribute is for adding the play, pause and volume controls Basic Syntax

58 Example : HTML 5 Playing Video Sample <video src="http://example.com/video/example_video.ogg" controls="controls" width=“600" height=“280"> Browser does not support HTML 5.0 Basic Syntax

59 The video element allows multiple source elements. Source elements can link to different video files. The browser will use the first recognized format : Your browser does not support the video tag. Basic Syntax

60 The HTML 5.0 supports the following attributes : Attribute AttributeValueDescription audiomuted Defining the default state of the the audio. Currently, only "muted" is allowed autoplay If present, then the video will start playing as soon as it is ready controls If present, controls will be displayed, such as a play button heightpixels Sets the height of the video player loop If present, the video will start over again, every time it is finished posterurl Specifies the URL of an image representing the video preload If present, the video will be loaded at page load, and ready to run. Ignored if "autoplay" is present srcurl The URL of the video to play widthpixels Sets the width of the video player


Download ppt "1. History, Vision & Future of HTML5 1.1 What Is HTML5? Successor of HTML 4.01 and XHTML 1.1 It comes with new tags, features and APIs Below is a non exhaustive."

Similar presentations


Ads by Google