What Is HTML5:
Html5 is the latest version(advance html) html that describe web pages.
Used by html5 we can create Responsive web application, means we can used it properly on any devices, it will be compatible with all type of devices.such as iphone, tablet, smartphones, etc.it will adjust their size according to devices.
Html5 is support to
“Touch Interface”, if we want to create a touch software, then we can make it by used of html5.
Html5 is support to all modern browsers.(google chrome, Mozilla, safari, opera, internet explorer), also support previous browsers.
New Html5 elements:
This elements <header> replace to the <div> elements in html.
Define header for documents or sections,we can use its as a container.
In this example we wraped some tags in <header>
Same like in html <div> we can wrap these elements.
Means divisions of webpage.
2. nav element is used to defines navigation links, The nav element represents a section of pages or to parts within the pagesIn this example we no need to give styling for horizontal navbar.
This elememts defines section in documents.
Web page is devided in to sections like introduction means: about , some contents, and contact information…
We can used it anywhere within webpage’s body.
This is elements is used to defines articles in webpage.
In this article include self contained contents..
Means blog post, forum post, news paper articles such as any subject which relate to ours websites..
So this elements is very useful for the to write related anything
which we want to tell something….
this elements is used for to make siderbar,
Sidebar should be related to surrounding content…
This elements is used to define footer for web page, document.
In footer section contains author of the document, copyright information, links to term of used, contact information.etc
You may have several <footer> elements in one document.
New Graphics Elements:
Svg means scalable vector graphics and its language used for to make 2d Graphics and graphical application.and svg is mostly useful for vector type diagram such as Pie, Chart.
html5 allow embeding svg directly using ….
this element is used to make drawing like graphics, circle, square, we can draw any shape using <canvas>..</canvas>
the latest version of browsers firefox, safari, chrome, opera, support to <canvas> element. but IE8 not support to this element.
Result will be :square with red color border:
Html5 support multimedia without flash player. If we want to include video/Audio on web page then there is no need to flash player.
this is tag is used to add video content in our web page.
<video src=”vedio file path” controls autoplay >
We can used <source> tag seperatly if we want to add media type and many others attributes,
There is two type of media one is video and another is ogg.
<audio>: this is tag is used to add sound content in our web page.
Ex:<audio src=”foo.wav” controls autoplay>
Your Browser doesn’t support the video element.
Features in Html5:
1.support to work with server and database. There is offline and online server support. There is better support for local offline storage.
2.Ediatble contents in html5:This feature help to allow the end users to edit the content.All you need to do is add an attributes named contentEditable=”true” to the html control.<p contenteditable=”true”>click here to edit the contents</p>New forms controls, like calendar, date, time, email, url, search.
3.html5 Autofocus and placeholder attributes: the placeholder attribute give small hint to user is display in the text area before the user enter the value.
4.Required field and Range validators in html5:
When we used required attribute in any input and textarea field, then that field should be mandatory to be filled.
We cant blank that field. We have to give input something in that field where we add required attribute.
<input type=”email” placeholder=”enter your email”required/>
Email validation is there if we enter the wrong email id in text box then error will display there.
5.Local storage: with local storage, web application can stored data locally within the user’s browser. And local storage is more secured.. and large amount of data can be stored locally, without affecting website performance.
Before html5 application the data had to be stored in cookies, included in every server request. Unlike cookies, the storage limit is far larger(atleast5mb) and information is never transffered to the server.
Html5 provide two type of local storage:
First is has no expiration date(windows.localStorage)
Data will not delete,it available for longtime.
Second one is for particular session- data is lost when tab closed.(window.sessionStorage)
Migration from html4 &html5:
Main thing is there is less of coding and styling in html5
In above example we see in html4 we take id for header, menus, content but in html5 there is no need to take separate id’s. becaused now these all tags are available in html5, so there is no need to take seperate id’s.
Differnce between Html and Html5
Doctype declaration is too longer
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
Audio, Video not supported
Html5 support multimedia
We can easily embed video and audio on our web page by using<video>& <audio> Tags.
Geolocation feature is not available
Geolocation API in html5
Find out the geographical position of user.
Html used cookies for storage
In html5 there is used of local storage its very secured.. data will available for long duration.
Can not draw shapes, such as tringle, circle, and graphics
in html5 <canvas> tag is there, by using this tag we can draw any shape, graphics..etc
Work with all old browsers
Support to modern browsers