HTML 5 Interview Questions & Answers
HTML5 Interview Questions & Answers – These FAQs covering HTML5 Canvas, SVG, Audio, Video, Semantic Elements etc for freshers as well as experienced.
What is !DOCTYPE in HTML?
A document type declaration, or DOCTYPE
, is an instruction to the web browser about the particular version of HTML.
In HTML5
you can simple type following line for document type declaration:<!DOCTYPE html>
in an HTML file.
Will HTML 5 works without !DOCTYPE ?
No, the browser will not be able to identify that it’s an HTML document and HTML 5 tags will not function properly.
How is the page structure of HTML 5 different from Previous HTML Versions?
A typical web page structure is made-up of headers, footers, navigation, central area and side bars. Before HTML 5 we defines them using DIV Tags with different classes/ids. HTML5 offers new elements for better document structure.
New Semantic/Structural Elements:<header>: Represents header data of HTML.<footer>
: Footer section of the page.<nav>
: Navigation elements in the page.<article>
: Self-contained content.<section>
: Used inside article to define sections or group content in to sections.<aside>
: Represent side bar contents of a page.
What are the different new form element types in HTML 5?
- color
- date
- DateTime
- DateTime-local
- month
- number
- range
- search
- tel
- time
- URL
- week
What are the New multimedia elements in HTML 5?
New multimedia elements: <audio>
and <video>.
The HTML5 <audio>
element is used to embed audio in a web page.
<audio controls>
<source src="song.mp3" type="audio/mpeg">
Your browser does not support the HTML 5 audio element.
</audio>
Similarly, we can use <video>
tag to embed video.