Proglan Session 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.

Slides:



Advertisements
Similar presentations
HTML5 Overview HOANGPT2. 1. General 2. New Elements List 3.
Advertisements

What is Multimedia ? Multi ( Multiple ) and Media ! So…. Information in multiple formats, including text, images, audio, video and animation :) It makes.
HTML5, OVERVIEW AND NEW FEATURES PowerPoint by Mason O’Mara.
Iframes & Images Using HTML.
More CSS - Page layout + HTML5 new features Boriana Koleva Room: C54
 A markup language  Structures content on the internet  Commonly used by web browsers.
HTML 5. What is HTML5? HTML5 will be the new standard for HTML, XHTML, and the HTML DOM. The previous version of HTML came in The web has changed.
HTML 5 Previous version: HTML4.01, 1999 Still work in progress, most browsers support some of it.
Tim Berners-Lee authors HTML in 1991, assisted by his colleagues at CERN,
HTML5 Fundamentals By RaedRASHEED 2015.
HTML 5 Tutorial Chapter 1 Introduction. What is HTML5? HTML5 will be the new standard for HTML, XHTML, and the HTML DOM. The previous version of HTML.
HTML Advanced: HTML 5. Welcome This slideshow presentation is designed to introduce you to HTML 5. It is the third of three HTML workshops available at.
Bartosz Kowalski Software Developer CERN. Presentation outline -HTML : introduction and history -HTML5 : -History and philosophy -New features -Structure.
Lecture 18. HTML5 and JavaScript Instructor: Jie Yang Department of Computer Science University of Massachusetts Lowell Exploring the Internet,
Chapter 14 Introduction to HTML
CS 415 N-Tier Application Development By Umair Ashraf July 16,2013 National University of Computer and Emerging Sciences Lecture # 12 HTML/ XHTML/ HTML5.
Web Design Basic Concepts.
Mark Branom, Continuing Studies.  HTML5 overview – what’s new?  New HTML5 elements  New HTML5 features  Guided Demonstrations  Forms  Video  Geolocation.
Session: 11. © Aptech Ltd. 2HTML5 Audio and Video / Session 11  Describe the need for multimedia in HTML5  List the supported media types in HTML5 
Chapter 11 Adding Media and Interactivity. Flash is a software program that allows you to create low-bandwidth, high-quality animations and interactive.
HTML5. What is HTML5? HTML5 will be the new standard for HTML. HTML5 is the next generation of HTML. HTML5 is still a work in progress. However, the major.
Week 09, Session 01 Other HTML Tags & HTML5 IF Website Development Presented by: RDT.
E0262 – MIS – Multimedia Storage Techniques SMIL – Synchronized Multimedia Integration Language.
HTML 5 New Standardization of HTML. I NTRODUCTION HTML5 is The New HTML Standard, New Elements New Attributes Full CSS3 Support Video and Audio 2D/3D.
HTML5 GAMING By Scott Benton. HTML5 New HTML Standard Previous Version of HTML, HTML 4.01, Released in 1999 Not an Official Standard Yet No Browsers Have.
Director of Computer Center, DaYeh University Ku-Yaw Chang.
IT Engineering I Instructor: Rezvan Shiravi
SIG WEB January 31, 3PM. What is HTML5? What it is: Allows for better intergration of media consumption. A new open standard Provides new APIs.
What is Web Design?  Web design is the creation of a Web page using hypertext or hypermedia to be viewed on the World Wide Web.
Building the User Interface by Using HTML5: Text, Graphics, and Media Lesson 2.
HTML Structure & syntax
Advanced Level Course. Site Extras Site Extras consist of four categories: Stationeries Site Trash Designs Components.
HTML Advanced: HTML 5. Introduction to HTML 5 These slides are based on source material found at the w3schools.com website.
The New Elements © Main Menu Structure Media Canvas Form Click on one of the categories below to view information about the new HTML5 elements in.
MIS 425 Lecture 3 – HTML 5 and CSS Instructor: Martin Neuhard
HTML Structure & syntax. Introduction This presentation introduces the following: Doctype declaration HTML Tags, Elements and Attributes Sections of a.
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
تکنیک های پیشرفته در برنامه سازی وب ) اسلايد نهم SVG - ) جوانمرد Website: به نام خدا.
UPLOAD / DOWNLOAD april  HTML5 is just the next iteration of HTML  Previous version was technically HTML 4.01, which incorporated XHTML 1.0.
HTML5 Gaurav Jaiswal Singsys Pte. Ltd.. What is HTML5?
Wednesday 5 December 2012 Part II. Wednesday 5 December Make an Element Draggable What to Drag - ondragstart and setData() Where to Drop - ondragover.
CHAPTER 15 HTML 5 VIDEO AND AUDIO Intro to HTML5 1.
Chapter 11 Adding Media and Interactivity. Chapter 11 Lessons Introduction 1.Add and modify Flash objects 2.Add rollover images 3.Add behaviors 4.Add.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring Forms, HTML5 layout.
(1) HTML5, CSS, Twitter Bootstrap. (2) HTML5 Will be the new standard New features Drag and Drop and Support for local storage,,,, New input types Removed.
Let’s look what flash can do: OK, that wasn’t flash! That was HTML5.
What is HTML5? HTML5 will be the new standard for HTML. The previous version of HTML, HTML 4.01, came in The web has changed a lot since then. HTML5.
Web Design Principles 5 th Edition Chapter 3 Writing HTML for the Modern Web.
Hyper Text Markup Language.  My First Heading My first paragraph. Example Explained The DOCTYPE declaration defines the document type The text between.
HTML 5 (Part 1) – Start from SCRATCH. HTML 5 – Start from SCRATCH.
Part – 3 : HTML 5 SVG Tag. † SVG stands for Scalable Vector Graphics. † SVG is used to define vector-based graphics for the Web. † SVG defines the graphics.
Agenda * What is HTML5 -- Its history and motivation * HTML/XHTML as Human / Machine Readable Format * HTML and its related technologies * Brief summary.
XHTML. What Is XHTML? XHTML stands for EXtensible HyperText Markup Language XHTML is almost identical to HTML XHTML is stricter than HTML XHTML is HTML.
HTML Structure & syntax
The HTML5 logo was introduced by W3C in 2010
HTML Advanced: HTML 5 With Adaptations by Dilvan Moreira.
Chapter 4: Feature Detection & Drag and Drop
HTML 5.
Gaurav Jaiswal Singsys Pte. Ltd.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Chapter 4: Scalable Vector Graphics (SVG)
HTML5 – The Saga Continues
PPT By:Gaurav Jaiswal Singsys Pte. Ltd.
HTML 5 Tutorial Chapter 1 Introduction.
Application with Cross-Platform GUI
Dive Into HTML5 - Start Using It Now! Mark Branom, Continuing Studies
HTML 5 Training HTML 5 SYMANTICS [Notes to trainer:
Creating a Basic Web Page using HTML
HTML5 - 2 Forms, Frames, Graphics.
Presentation transcript:

Proglan Session 1

.

 HTML5 will be the new standard for HTML.  The previous version of HTML, HTML 4.01, came in 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.

 HTML5 is a cooperation between the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG).  WHATWG was working with web forms and applications, and W3C was working with XHTML 2.0. In 2006, they decided to cooperate and create a new version of HTML.  Some rules for HTML5 were established:  New features should be based on HTML, CSS, DOM, and JavaScript  Reduce the need for external plugins (like Flash)  Better error handling  More markup to replace scripting  HTML5 should be device independent  The development process should be visible to the public

 In HTML5 there is only one declaration, and it is very simple:

Below is a simple HTML5 document, with the minimum of required tags: Title of the document The content of the document......

 Some of the most interesting new features in HTML5:  The element for 2D drawing  The and elements for media playback  Support for local storage  New content-specific elements, like,,,,  New form controls, like calendar, date, time, , url, search

 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.

 The internet has changed a lot since HTML 4.01 became a standard in  Today, some elements in HTML 4.01 are obsolete, never used, or not used the way they were intended to. These elements are removed or re- written in HTML5.  To better handle today's internet use, HTML5 includes new elements for better structure, better form handling, drawing, and for media content.

TagDescription Defines an article Defines content aside from the page content Isolates a part of text that might be formatted in a different direction from other text outside it Defines a command button that a user can invoke Defines additional details that the user can view or hide Defines a visible heading for a element Specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.

TagDescription Defines a caption for a element Defines a footer for a document or section Defines a header for a document or section Groups a set of to elements when a heading has multiple levels Defines marked/highlighted text Defines a scalar measurement within a known range (a gauge) Defines navigation links Represents the progress of a task

TagDescription Defines a ruby annotation (for East Asian typography) Defines an explanation/pronunciation of characters (for East Asian typography) Defines what to show in browsers that do not support ruby annotations Defines a section in a document Defines a date/time Defines a possible line-break

NEW MEDIA ELEMENTS TagDescription Defines sound content Defines a video or movie Defines multiple media resources for and Defines a container for an external application or interactive content (a plug-in) Defines text tracks for and

THE NEW ELEMENT TagDescription Used to draw graphics, on the fly, via scripting (usually JavaScript)

NEW FORM ELEMENTS TagDescription Specifies a list of pre-defined options for input controls Defines a key-pair generator field (for forms) Defines the result of a calculation

 The following HTML 4.01 elements are removed from HTML5: 

VIDEO ON THE WEB  Until now, there has not been a standard for showing a video/movie on a web page.  Today, most videos are shown through a plug-in (like flash). However, different browsers may have different plug-ins.  HTML5 defines a new element which specifies a standard way to embed a video/movie on a web page: the element.

 Internet Explorer 9, Firefox, Opera, Chrome, and Safari support the element.

HTML5 VIDEO - HOW IT WORKS To show a video in HTML5, this is all you need: Your browser does not support the video tag.

VIDEO FORMATS AND BROWSER SUPPORT BrowserMP4WebMOgg Internet Explorer 9 YESNO Firefox 4.0NOYES Google Chrome 6YES Apple Safari 5YESNO Opera 10.6NOYES Currently, there are 3 supported video formats for the element: MP4, WebM, and Ogg

HTML5 VIDEO TAGS TagDescription Defines a video or movie Defines multiple media resources for media elements, such as and Defines text tracks in mediaplayers

& Your browser does not support the video tag.

 The HTML5 element also has methods, properties, and events.  There are methods for playing, pausing, and loading, for example.  There are properties (e.g. duration, volume, seeking) that you can read or set.  There are also DOM events that can notify you, for example, when the element begins to play, is paused, is ended, etc.

HTML5 - METHODS, PROPERTIES, AND EVENTS MethodsPropertiesEvents play()currentSrcplay pause()currentTimepause load()videoWidthprogress canPlayTypevideoHeighterror durationtimeupdate ended errorabort pausedempty mutedemptied seekingwaiting volumeloadedmetadata height width

AUDIO ON THE WEB  Until now, there has not been a standard for playing audio files on a web page.  Today, most audio files are played through a plug-in (like flash). However, different browsers may have different plug-ins.  HTML5 defines a new element which specifies a standard way to embed an audio file on a web page: the element.

 Internet Explorer 9, Firefox, Opera, Chrome, and Safari support the element.

 To play an audio file in HTML5, this is all you need: Your browser does not support the audio element.

AUDIO FORMATS AND BROWSER SUPPORT BrowserMP3WavOgg Internet Explorer 9 YESNO Firefox 4.0NOYES Google Chrome 6YES Apple Safari 5YES NO Opera 10.6NOYES

TagDescription Defines sound content Defines multiple media resources for media elements, such as and

DRAG AND DROP  Drag and drop is a very common feature. It is when you "grab" an object and drag it to a different location.  In HTML5, drag and drop is part of the standard, and any element can be draggable.

BROWSER SUPPORT

function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("Text",ev.target.id); } function drop(ev) { ev.preventDefault(); var data=ev.dataTransfer.getData("Text"); ev.target.appendChild(document.getElementById( data)); }

MAKE AN ELEMENT DRAGGABLE  First of all: To make an element draggable, set the draggable attribute to true:

 Then, specify what should happen when the element is dragged.  In the example above, the ondragstart attribute calls a function, drag(event), that specifies what data to be dragged.  The dataTransfer.setData() method sets the data type and the value of the dragged data:  function drag(ev)  {  ev.dataTransfer.setData("Text",ev.target.id);  }  In this case, the data type is "Text" and the value is the id of the draggable element ("drag1").

 The ondragover event specifies where the dragged data can be dropped.  By default, data/elements cannot be dropped in other elements. To allow a drop, we must prevent the default handling of the element.  This is done by calling the event.preventDefault() method for the ondragover event:  event.preventDefault()

DO THE DROP - ONDROP  When the dragged data is dropped, a drop event occurs.  In the example above, the ondrop attribute calls a function, drop(event):  function drop(ev) { ev.preventDefault(); var data=ev.dataTransfer.getData("Text"); ev.target.appendChild(document.getElementById( data)); }

 The HTML5 element is used to draw graphics, on the fly, via scripting (usually JavaScript).  The 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.

 Internet Explorer 9, Firefox, Opera, Chrome, and Safari support the element.

CREATE A CANVAS  A canvas is specified with the element.  Specify the id, width, and height of the element:

DRAW WITH JAVASCRIPT  The element has no drawing abilities of its own.  All drawing must be done inside a JavaScript: var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.fillStyle="#FF0000"; ctx.fillRect(0,0,150,75);

UNDERSTANDING COORDINATES  The fillRect property above had the parameters (0,0,150,75).  This means: Draw a 150x75 rectangle on the canvas, starting at the top left corner (0,0).  The canvas' X and Y coordinates are used to position drawings on the canvas.

 Draw a line by specifying where to start, and where to stop

 Draw a circle by specifying the size, color, and position

EXAMPLE - GRADIENT  Draw a gradient background with the colors you specify

 Put an image on the canvas:

HTML5 TAG TagDescription Used to draw graphics, on the fly, via scripting (usually JavaScript)

 anvas.asp anvas.asp

 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  SVG is a W3C recommendation

 Advantages of using SVG over other image formats (like JPEG and GIF) are:  SVG images can be created and edited with any text editor  SVG images can be searched, indexed, scripted, and compressed  SVG images are scalable  SVG images can be printed with high quality at any resolution  SVG images are zoomable (and the image can be zoomed without degradation)

 Internet Explorer 9, Firefox, Opera, Chrome, and Safari support the element.

EMBED SVG DIRECTLY INTO HTML PAGES  In HTML5, you can embed SVG elements directly into your HTML page:  Example

HTML5 CANVAS VS. SVG

SVG  SVG is a language for describing 2D graphics in XML.  SVG is XML based, which means that every element is available within the SVG DOM. You can attach JavaScript event handlers for an element.  In SVG, each drawn shape is remembered as an object. If attributes of an SVG object are changed, the browser can automatically re-render the shape.

CANVAS  Canvas draws 2D graphics, on the fly (with a JavaScript).  Canvas is rendered pixel by pixel.  In canvas, once the graphic is drawn, it is forgotten by the browser. If its position should be changed, the entire scene needs to be redrawn, including any objects that might have been covered by the graphic.

COMPARISON OF CANVAS AND SVG CanvasSVG Resolution dependent No support for event handlers Poor text rendering capabilities You can save the resulting image as.png or.jpg Best suited for graphic-intensive games where many objects are redrawn frequently Resolution independent Support for event handlers Best suited for applications with large rendering areas (Google Maps) Slow rendering if complex (anything that uses the DOM a lot will be slow) Not suited for game applications

HTML5 GEOLOCATION

LOCATE THE USER'S POSITION  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.

 Internet Explorer 9, Firefox, Opera, Chrome, and Safari support the element.

 Use the getCurrentPosition() method to get the user's position.  The example below is a simple Geolocation example returning the latitude and longitude of the user's position:  Example var x=document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else{x.innerHTML="Geolocation is not supported by this browser.";} } function showPosition(position) { x.innerHTML="Latitude: " + position.coords.latitude + " Longitude: " + position.coords.longitude; }

HANDLING ERRORS AND REJECTIONS function showError(error) { switch(error.code) { case error.PERMISSION_DENIED: x.innerHTML="User denied the request for Geolocation." break; case error.POSITION_UNAVAILABLE: x.innerHTML="Location information is unavailable." break; case error.TIMEOUT: x.innerHTML="The request to get user location timed out." break; case error.UNKNOWN_ERROR: x.innerHTML="An unknown error occurred." break; } }

DISPLAYING THE RESULT IN A MAP  Example function showPosition(position) { var latlon=position.coords.latitude+","+position.coords.longitude; var img_url=" +latlon+"&zoom=14&size=400x300&sensor=false"; document.getElementById("mapholder").innerHTML=" "; }

LOCATION-SPECIFIC INFORMATION  This page demonstrated how to show a user's position on a map. However, Geolocation is also very useful for location-specific information.  Examples:  Up-to-date local information  Showing Points-of-interest near the user  Turn-by-turn navigation (GPS)

THE GETCURRENTPOSITION() METHOD - RETURN DATA PropertyDescription coords.latitudeThe latitude as a decimal number coords.longitudeThe longitude as a decimal number coords.accuracyThe accuracy of position coords.altitudeThe altitude in meters above the mean sea level coords.altitudeAccuracyThe altitude accuracy of position coords.headingThe heading as degrees clockwise from North coords.speedThe speed in meters per second timestampThe date/time of the response