Q1) What is the difference between HTML and HTML5 ?
Ans: HTML5 is nothing more then upgraded version of HTML where in HTML5 Lot of new future like
Audio/mp3,
Video,
date select function ,
Canvas,
2D/3D Graphics,
placeholder ,
Local SQL Database
added so that no need to do external plugin like Flash player or other library.
Q2) What is the <!DOCTYPE> ? Is it necessary to use in HTML5 ?
The <!DOCTYPE> is an instruction to the web browser about what version of HTML the page is written in.
The <!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).
Q3) How many New Markup Elements you know in HTML5 ?
Below are the New Markup Elements or Tag Description added in HTML5
<article> Specifies independent, self-contained content, could be a news-article, blog post, forum post, or other articles which can be distributed independently from the rest of the site.
<aside> For content aside from the content it is placed in. The aside content should be related to the surrounding content
<bdi> For text that should not be bound to the text-direction of its parent 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
<footer> For a footer of a document or section, could include the name of the author, the date of the document, contact information, or copyright information
<header> For an introduction of a document or section, could include navigation
<hgroup> For a section of headings, using <h1> to <h6>, where the largest is the main heading of the section, and the others are sub-headings
<mark> For text that should be highlighted
<meter> For a measurement, used only if the maximum and minimum values 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
<section> For a section in a document. Such as chapters, headers, footers, or 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.
Q4) What are the HTML5 New input Types ?
• search
• tel
• time
• color
• email
• month
• date
• datetime
• datetime-local
• number
• range
• url
• week
Q5) What are the HTML5 New Form Attributes?
• pattern
• placeholder
• required
• step
• autocomplete
• autofocus
• height and width
• list
• min and max
• multiple
• form
• formaction
• formenctype
• formmethod
• formnovalidate
• formtarget
Q6) What is SVG and advantages of SVG?
Ans: SVG is a language for describing two-dimensional vector graphics in XML.
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
Q7) What are the Advantages of svg ?
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)
Q8) What are the Differences Between SVG and Canvas:
Ans: SVG is a language for describing 2D graphics in XML.
Canvas draws 2D graphics, on the fly (with a JavaScript).
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 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.
Q9) What the use of Canvas Element in HTML5?
Ans: The canvas element is used to draw graphics images on a web page by using javascript like below
<canvas id=“pcdsCanvas” width=“500″ height=“400″>
</canvas>
<script type=“text/javascript”>
var pcdsCanvas=document.getElementById(“phpzagCanvas”);
var pcdsText=pcdsCanvas.getContext(“2d”);
pcdsText.fillStyle=“#82345c”;
pcdsText.fillRect(0,0,150,75);
</script>
Q10) What are the New Media Elements in HTML5 ?
<audio> For multimedia content, sounds, music or other audio streams
<video> For video content, such as a movie clip or other video streams
<source>Defines multiple media resources for media elements, such as <video> and <audio> For embedded content, such as a plug-in
<track> For text tracks used in mediaplayers.
Q11) How to add video and audio in HTML5 ?
Ans: Before HTML5, videos could only be played with a plug-in (like flash). However, different browsers supported different plug-ins.
HTML5 defines a new element which specifies a standard way to embed a video or movie on a web page: the <video> element.
Like below we can add video in html5
<video width=“200″ height=“150″ controls=“controls”>
<source src=“video.mp4″ type=“video/mp4″ />
<source src=“video.ogg” type=“video/ogg” />
</video>
And audio like this
<audio controls=“controls”>
<source src=“audio.ogg” type=“audio/ogg” />
<source src=“audio.mp3″ type=“audio/mpeg” />
</audio>
Q12) What is HTML5 Web Storage?
Ans: In HTML5, we can store data locally within the user’s browser.It is possible to store large amounts of data without affecting the website’s performance.Web Storage is more secure and faster.
there are two types of Web Storages
1.LocalStorage: stores data locally with no limit
2.SessionStorage: stores data for one session
Q13) What is the use of localStorage in HTML5?
Ans: Before HTML5 LocalStores was done with cookies. Cookies are not very good for large amounts of data, because they are passed on by every request to the server, so it was very slow and in-effective.
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=“kumar”;
document.write(localStorage.name);
</script>
<script type=“text/javascript”>
localStorage.address=“hyderabad”;
document.write(localStorage.address);
</script>
Q14) What is the use of sessionStorage Object in html5 ?
Ans: The sessionStorage object stores the data for one session. The data is deleted when the user closes the browser window. like below we can create and access a sessionStorage here we created “name” as session
<script type=“text/javascript”>
sessionStorage.name=“kumar”;
document.write(sessionStorage.name);
</script>
Ans: HTML5 is nothing more then upgraded version of HTML where in HTML5 Lot of new future like
Audio/mp3,
Video,
date select function ,
Canvas,
2D/3D Graphics,
placeholder ,
Local SQL Database
added so that no need to do external plugin like Flash player or other library.
Q2) What is the <!DOCTYPE> ? Is it necessary to use in HTML5 ?
The <!DOCTYPE> is an instruction to the web browser about what version of HTML the page is written in.
The <!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).
Q3) How many New Markup Elements you know in HTML5 ?
Below are the New Markup Elements or Tag Description added in HTML5
<article> Specifies independent, self-contained content, could be a news-article, blog post, forum post, or other articles which can be distributed independently from the rest of the site.
<aside> For content aside from the content it is placed in. The aside content should be related to the surrounding content
<bdi> For text that should not be bound to the text-direction of its parent 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
<footer> For a footer of a document or section, could include the name of the author, the date of the document, contact information, or copyright information
<header> For an introduction of a document or section, could include navigation
<hgroup> For a section of headings, using <h1> to <h6>, where the largest is the main heading of the section, and the others are sub-headings
<mark> For text that should be highlighted
<meter> For a measurement, used only if the maximum and minimum values 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
<section> For a section in a document. Such as chapters, headers, footers, or 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.
Q4) What are the HTML5 New input Types ?
• search
• tel
• time
• color
• month
• date
• datetime
• datetime-local
• number
• range
• url
• week
Q5) What are the HTML5 New Form Attributes?
• pattern
• placeholder
• required
• step
• autocomplete
• autofocus
• height and width
• list
• min and max
• multiple
• form
• formaction
• formenctype
• formmethod
• formnovalidate
• formtarget
Q6) What is SVG and advantages of SVG?
Ans: SVG is a language for describing two-dimensional vector graphics in XML.
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
Q7) What are the Advantages of svg ?
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)
Q8) What are the Differences Between SVG and Canvas:
Ans: SVG is a language for describing 2D graphics in XML.
Canvas draws 2D graphics, on the fly (with a JavaScript).
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 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.
Q9) What the use of Canvas Element in HTML5?
Ans: The canvas element is used to draw graphics images on a web page by using javascript like below
<canvas id=“pcdsCanvas” width=“500″ height=“400″>
</canvas>
<script type=“text/javascript”>
var pcdsCanvas=document.getElementById(“phpzagCanvas”);
var pcdsText=pcdsCanvas.getContext(“2d”);
pcdsText.fillStyle=“#82345c”;
pcdsText.fillRect(0,0,150,75);
</script>
Q10) What are the New Media Elements in HTML5 ?
<audio> For multimedia content, sounds, music or other audio streams
<video> For video content, such as a movie clip or other video streams
<source>Defines multiple media resources for media elements, such as <video> and <audio> For embedded content, such as a plug-in
<track> For text tracks used in mediaplayers.
Q11) How to add video and audio in HTML5 ?
Ans: Before HTML5, videos could only be played with a plug-in (like flash). However, different browsers supported different plug-ins.
HTML5 defines a new element which specifies a standard way to embed a video or movie on a web page: the <video> element.
Like below we can add video in html5
<video width=“200″ height=“150″ controls=“controls”>
<source src=“video.mp4″ type=“video/mp4″ />
<source src=“video.ogg” type=“video/ogg” />
</video>
And audio like this
<audio controls=“controls”>
<source src=“audio.ogg” type=“audio/ogg” />
<source src=“audio.mp3″ type=“audio/mpeg” />
</audio>
Q12) What is HTML5 Web Storage?
Ans: In HTML5, we can store data locally within the user’s browser.It is possible to store large amounts of data without affecting the website’s performance.Web Storage is more secure and faster.
there are two types of Web Storages
1.LocalStorage: stores data locally with no limit
2.SessionStorage: stores data for one session
Q13) What is the use of localStorage in HTML5?
Ans: Before HTML5 LocalStores was done with cookies. Cookies are not very good for large amounts of data, because they are passed on by every request to the server, so it was very slow and in-effective.
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=“kumar”;
document.write(localStorage.name);
</script>
<script type=“text/javascript”>
localStorage.address=“hyderabad”;
document.write(localStorage.address);
</script>
Q14) What is the use of sessionStorage Object in html5 ?
Ans: The sessionStorage object stores the data for one session. The data is deleted when the user closes the browser window. like below we can create and access a sessionStorage here we created “name” as session
<script type=“text/javascript”>
sessionStorage.name=“kumar”;
document.write(sessionStorage.name);
</script>
No comments:
Post a Comment