Html5 Interview Questions & Answers

475 views 5 slides Mar 08, 2019
Slide 1
Slide 1 of 5
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5

About This Presentation

Read Best Html5 interview questions with their answers.hether you're a candidate or interviewer, these interview questions will help ...


Slide Content

HTML Interview Q's




1) What is HTML? What are the new features of HTML5?
Ans): It Stands For Hyper Text Markup Language. It Was Created By Berners-Lee.
By Using Html We Can Create Our Own Static Web Sites.
Hyper Text: It Means "Text Within Text".
Markup Language: It Is A Programming Language That Is Used Make Text More
Interactive And Dynamic.
Features of HTML5:
 Email Inputs
 Audio Supports
 Video Support
 Regular Expression
 Small Tag
 New Doctype
 Placeholder
 Figure Elements
 Local Storage
 Svg,Canvas
 Semantic Tags :
 <article>
 <aside>
 <details>
 <figcaption>
 <figure>
 <footer>
 <header>
 <main>
 <mark>
 <nav>
 <section>
 <summary>
 <time>

HTML Interview Q's


2) What is Application cache? What are the advantages of Application cache?
Ans): The application cache is used to store and retrieve web resources.
Loading resources from the cache is faster and more effective than loading from the
network.
Advantages:
 Offline browsing: users can navigate a site even when they are offline.
 Speed: cached resources are local, and therefore load faster.
 Reduced server load: the browser only downloads resources that have changed
from the server.

3) Difference between SPAN and DIV?
Ans): DIV is used for block level elements and SPAN is used for inline elements.
Block Level Elements:
 P.
 h1, h2, h3, h4, h5, h6.
 ol, ul.
 pre.
 address.
 blockquote.
 dl.
 div.
Inline Elements:
 Span
 Label

4) What is the difference between local storage and cookies
Ans): local Storage and Cookies all are used to store data on the client side. Each
one has its own storage and expiration limit.
Cookies only allow you to store strings.

HTML Interview Q's


5) What is the difference between local storage and session storage?
Ans): Local storage:
1) Web page can be viewed simplicitily for greater storage capacity.
2) The data is send back to the server for every HTTP request
(html,images,javascript,css,etc) reducing amount of trafic between
client and server
Session storage:
1) Similar to localStorage but expires when the browser closed (not the
tab).
2) changes are available per window
3) Data is only available inside window/door in which it was set

6) What is viewport?
Ans): The viewport is the user's visible area of a web page.
The viewport varies with the device, and will be smaller on a mobile
phone than on a computer screen.
Before tablets and mobile phones, web pages were designed only for
computer screens, and it was common for web pages to have a static
design and a fixed size.
HTML5 introduced a method to let web designers take control over the
viewport, through the <meta> tag.

7) What is META tag?
Ans): Metadata is data (information) about data.
The <meta> tag provides metadata about the HTML document. Metadata
will not be displayed on the page, but will be machine parsable.

HTML Interview Q's


8) What is the difference between SVG and Canvas?
Ans): SVG:
 Shape based
 Multiple graphical elements, which become part of the DOM
 Modified through script and CSS
 Event model/user interaction is abstracted (rect, path)
 Performance is better with smaller number of objects (<10k), a larger
surface, or both
Canvas:
 Pixel based (Dynamic .png)
 Single HTML element.(Inspect element in Developer tool. You can see
only canvas tag)
 Modified through script only
 Event model/user interaction is granular (x,y)
 Performance is better with smaller surface, a larger number of objects
(>10k), or both

9) What is Geolocation in HTML5? Give me example?
Ans): HTML5 Geolocation API lets you share your location with your favorite web
sites. A JavaScript can capture your latitude and longitude and can be sent to
backend web server and do fancy location-aware things like finding local businesses
or showing your location on a map.
var geolocation = navigator.geolocation;

10) What is Doctype? What are the DOCTYPE Declarations in HTML?
Ans): The <!DOCTYPE> declaration must be the very first thing in your HTML
document, before the <html> tag.
The <!DOCTYPE> declaration is not an HTML tag; it is an instruction to the web
browser about what version of HTML the page is written in.

HTML Interview Q's


In HTML 4.01, the <!DOCTYPE> declaration refers to a DTD, because HTML 4.01
was based on SGML. The DTD specifies the rules for the markup language, so that
the browsers render the content correctly.
HTML5 is not based on SGML, and therefore does not require a reference to a DTD.
Tags