HTML 5
HTML 5
Questions :
What is the difference between HTML and HTML5 ?
1
Answers : HTML5 is nothing more then upgreaded version of HTML where in HTML5 Lot of new future like Video, Audio/mp3, date
1 select function , placeholder , Canvas, 2D/3D Graphics, Local SQL Database added so that no need to do external plugin
like Flash player or other library
Questions
What is the <!DOCTYPE> ? Is it necessary to use in HTML5 ?
: 2
Answers : The <!DOCTYPE> is an instruction to the web browser about what version of HTML the page is written in. AND The
2 <!DOCTYPE> tag does not have an end tag and It is not case sensitive.
The <!DOCTYPE> declaration must be the very first thing in HTML5 document, before the <html> tag. As In HTML 4.01,
all <! DOCTYPE > declarations require a reference to a Document Type Definition (DTD), because HTML 4.01 was based
on Standard Generalized Markup Language (SGML). WHERE AS HTML5 is not based on SGML, and therefore does not
require a reference to a Document Type Definition (DTD).
Questions
How many New Markup Elements you know in HTML5
: 3
Answer : Below are the New Markup Elements added in HTML5
3
Tag Description
Specifies independent, self-contained content, could be a news-
<article> article, blog post, forum post, or other articles which can be
distributed independently from the rest of the site.
For content aside from the content it is placed in. The aside content
<aside>
should be related to the surrounding content
For text that should not be bound to the text-direction of its parent
<bdi>
elements
<command> A button, or a radiobutton, or a checkbox
<details> For describing details about a document, or parts of a document
<summary> A caption, or summary, inside the details element
<figure> For grouping a section of stand-alone content, could be a video
<figcaption> The caption of the figure section
For a footer of a document or section, could include the name of the
<footer> author, the date of the document, contact information, or copyright
information
For an introduction of a document or section, could include
<header>
navigation
For a section of headings, using <h1> to <h6>, where the largest is
<hgroup>
the main heading of the section, and the others are sub-headings
<mark> For text that should be highlighted
For a measurement, used only if the maximum and minimum values
<meter>
are known
<nav> For a section of navigation
<progress> The state of a work in progress
<ruby> For ruby annotation (Chinese notes or characters)
<rt> For explanation of the ruby annotation
<rp> What to show browsers that do not support the ruby element
For a section in a document. Such as chapters, headers, footers, or
<section>
any other sections of the document
<time> For defining a time or a date, or both
<wbr> Word break. For defining a line-break opportunity.
Questions
What are the New Media Elements in HTML5? is canvas element used in HTML5
: 4
Answer : Below are the New Media Elements have added in HTML5
4
Tag Description
<audio> For multimedia content, sounds, music or other audio streams
<video> For video content, such as a movie clip or other video streams
For media resources for media elements, defined inside video or
<source>
audio elements
<embed> For embedded content, such as a plug-in
<track> For text tracks used in mediaplayers
yes we can use Canvas element in html5 like below
<canvas>
Questions
Do you know New Input Type Attribute in HTML5
: 5
Answers : Yes we can use below new input type Attribute in HTML5
5
Type Value
tel The input is of type telephone number
search The input field is a search field
url a URL
email One or more email addresses
datetime A date and/or time
date A date
month A month
week A week
time The input value is of type time
datetime-
A local date/time
local
number A number
range A number in a given range
color A hexadecimal color, like #82345c
Specifies a short hint that describes the expected value of an input
placeholder
field
Questions
How to add video and audio in HTML5
: 6
Answers : Like below we can add video in html5
6
<video width="320" height="240" controls="controls">
<source src="pcds.mp4" type="video/mp4" />
<source src="pcds.ogg" type="video/ogg" />
</video>
In HTML5, the data is NOT passed on by every server request, but used ONLY when asked for. It is possible to store
large amounts of data without affecting the website's performance.and The data is stored in different areas for different
websites, and a website can only access data stored by itself.
And for creating localstores just need to call localStorage object like below we are storing name and address
<script type="text/javascript">
localStorage.name="PCDS";
document.write(localStorage.name);
</script>
<script type="text/javascript">
localStorage.address="Mumbai India..";
document.write(localStorage.address);
</script>
Questions
What is the sessionStorage Object in html5 ? How to create and access ?
: 9
Answers : The sessionStorage object stores the data for one session. The data is deleted when the user closes the browser window.
9 like below we can create and access a sessionStorage here we created "name" as session
<script type="text/javascript">
sessionStorage.name="PCDS";
document.write(sessionStorage.name);
</script>