HTML Interview Questions & HTML5 Interview Questions in 2021
HTML Interview Questions & HTML5 Interview Questions in 2021
HTML Interview Questions & HTML5 Interview Questions in 2021
Interview Questions
Interview Questions
Uncategorized
Tanuja Bahirat
Oct 6, 2020
0
HTML or Hypertext markup Language is a markup language that is used to
create web pages. It helps you define how a web page looks, and how the
content can be displayed with the help of elements. There is a high demand
among the employers for individuals who possess HTML skills. It is therefore
essential for you to prepare yourself with the frequently asked HTML Interview
questions if you want to land your dream job! This blog covers questions that
will help freshers, as well as advanced professionals. The questions are divided
into groups as follows.
1. What is HTML?
The full form of HTML stands for Hypertext Markup Language and it also
allows the user to create and structure sections, paragraphs, headings, links,
and blockquotes for web pages and applications.
Images are not inserted into a web page basically they are linked to web pages.
The <img> tag helps to create a holding space for the referenced image.
The <img> tag is normally empty, it has attributes only, and does not have a
closing tag.
In order to add a background image on an HTML element you need to use two
things:
Normally HTML comments are not being displayed in the browser. But these
comments can help to document the HTML source code.
<!– Write your comments here –>
Full form of CSS stands for Cascading Style Sheets (CSS) which is used to
format the layout of a webpage.
With the help of CSS, someone can control the color, font, the size of text, the
spacing between elements and also how elements are positioned and laid out,
what background images or background colors to be used, different displays
for different devices and screen sizes, and so many more as well.
Types of CSS:
So there are three ways to add CSS to HTML documents :
The most common and used way to add CSS, is to have the styles in external
CSS files.
Inline CSS
An inline CSS can be used to apply a unique and also different style to a single
HTML element.
Now put the text color of the <h1> element to red, and the text color of the
<p> element to blue:
Internal CSS
An internal CSS can be used to define a style for a single HTML page.
An internal CSS is used to define in the <head> section of an HTML page and
also within a <style> element.
Now let’s have an example of the text color of ALL the <h1> elements (on that
page) to blue, and the text color of ALL the <p> elements to red.
<!DOCTYPE html>
<html>
<head>
<style>
h1 {color: blue;}
p {color: red;}
</style>
</head>
<body>
External CSS
An external style sheet concept is normally used to define the style for many
HTML pages.
In order to start using an external style sheet, put a link to it in the <head>
section of each HTML page:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Basically, if you want to align your text using HTML, then you need to use css
and follow the proper process:
div.a {
text-align: center;
div.b {
text-align: left;
div.c {
text-align: right;
}
div.c {
text-align: justify;
HTML tables help web developers to set the data into rows and columns.
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Hobbies</th>
</tr>
<tr>
<td>Ram</td>
<td>Kumar</td>
<td>Travelling</td>
</tr>
<tr>
<td>Shyam</td>
<td>Chadra</td>
<td>Reading books</td>
</tr>
</table>
If you are working in a Windows system then open an HTML web page in
Internet Explorer, Google Chrome or Firefox.
On a Mac, open an HTML web page in Firefox
Press on the “Convert to PDF” button in the Adobe PDF toolbar in
order to get started with the PDF conversion
Enter the filename and save your new PDF file in a desired location
The HTML style attribute is the option to add styles to an element, like: Color,
Font, Size, and more.
<!DOCTYPE html>
<html>
<body>
<p>I am normal</p>
</body>
</html>
11. How to change font color in HTML?
1. <font Color=”Blue”>
2. <font color=”rgb(128,128,0)”
3. <font color=”#00FF00″>
<!DOCTYPE html>
<html>
<head>
<title>
</title>
</head>
<body>
<font color="orange">
<!-- The color attribute of font tag sets the color name 'orange'
for the word Great Learningt-->
<center>
<h1>
Great Learning
</h1>
</center>
</font>
</body>
</html>
<!DOCTYPE html>
<html>
<body style="background-color:powderblue;">
</body>
</html>
13. What is doctype in HTML?
The HTML Document Type.
<!DOCTYPE html>
<html>
<head>
<title>HTML Font</title>
</head>
<body>
<h1>Our Products</h1>
<p style = "font-family:georgia,garamond,serif;font-
size:16px;font-style:italic;">
</p>
</body>
</html>
DOM stands for Document Object Model. When a web page is getting loaded
that time the browser creates a Document Object Model of the page and it is
constructed as a tree of Objects. HTML DOM is basically an Object Model for
HTML.
<form>
</form>
19. How to create button in HTML?
<option value="Mango">Mango</option>
<option value="Lichhi">Licchi</option>
</select>
The div tag stands for Division tag. This is used in HTML to make divisions of
content in the web page like text, images, header, footer, navigation bar, etc.
Div tag has two parts like:
1. open(<div>) and
2. closing (</div>) tag and it is mandatory to maintain the tag.
The Div is the most used tag in web page development because it has
power to separate respective data in the web page and also a particular
section can be created for particular data or function in the web pages.
<html>
<head>
<title>div tag demo</title>
<style type=text/css>
p{
background-color:gray;
margin: 100px;
div
color: white;
background-color: 009900;
margin: 4px;
font-size: 35px;
</style>
</head>
<body>
</body>
</html>
HTML is used to make static web pages and HTML stands for markup
language.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Demo</h1>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1 style="color:red;font-size:40px;">Heading</h1>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
.button {
background-color: #4CAF50; /* Green */
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
</style>
</head>
<body>
<h2>Button Colors</h2>
<button class="button">Green</button>
<button class="buttonbuttondemo4">Black</button>
</body>
</html>
30. What is the difference between html and html5?
When HTML5 was released that time the primary objective was to improve
the World Wide Web experience for developers and end-users. :
<option value="Mango">Mango</option>
<option value="Apple">Apple</option>
</select>
<u> tag is used for underline the text. The <u> tag was deprecated in HTML,
but then they re-introduced in HTML5.
<!DOCTYPE html>
<html>
<head>
<style>
.square {
height: 50px;
width: 50px;
background-color: #555;
</style>
</head>
<body>
<div class="square"></div>
</body>
</html>
Images are not inserted into a web page basically they are linked to web pages.
The <img> tag helps to create a holding space for the referenced image.
The <img> tag is normally empty, it has attributes only, and does not have a
closing tag.
<font Color=”Blue”>
<font color=”rgb(128,128,0)”
<font color=”#00FF00″>
<!DOCTYPE html>
<html>
<head>
<title>
Example of color attribute
</title>
</head>
<body>
<font color="orange">
<!-- The color attribute of font tag sets the color name 'orange'
for the word Great Learningt-->
<center>
<h1>
Great Learning
</h1>
</center>
</font>
</body>
</html>
37. How to add a link in HTML?
To add links in html we use <a> and </a> tags, which are the tags used to
define the links. The <a> tag indicates where the hyperlink starts and the </a>
tag indicates where it ends. Whatever text gets added inside these tags, will
work as a hyperlink. Add the URL for the link in the <a href=” ”>.
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
39. How to create a checkbox in HTML?
<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color: lightgrey;
width: 300px;
border: 15px solid green;
padding: 50px;
margin: 20px;
</style>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div.ex1 {
background-color: lightblue;
width: 110px;
height: 110px;
overflow: scroll;
div.ex2 {
background-color: lightblue;
width: 110px;
height: 110px;
overflow: hidden;
div.ex3 {
background-color: lightblue;
width: 110px;
height: 110px;
overflow: auto;
div.ex4 {
background-color: lightblue;
width: 110px;
height: 110px;
overflow: visible;
}
</style>
</head>
<body>
<h2>scroll:</h2>
</body>
</html>
42. What is an attribute in HTML?
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1 style="color:red;font-size:40px;">Heading</h1>
</html>
<!DOCTYPE html>
<html>
<body>
<h1>The footer element</h1>
<footer>
<p>demo of footer<br>
<a href="mailto:admin@example.com">admin@example.com</a></p>
</footer>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<header>
<b>hey</b>
</header>
</body>
</html>
52. How to give space between two buttons in HTML?
<div class='myDiv'>
<button>Button 3</button>
</div>
The width and height attributes always define the width and height of the
image in pixels.
</video>
You can create a .png image and then use f the following snippets between the
<head> tags for the static HTML documents:
<div class="container">
<div class="bottom-left">Left</div>
<div class="centered">Middle</div>
</div>
The HTML <blink> tag stands for a non-standard element that is used to
create an enclosed text. It flashes slowly and normally blinks, meaning is light
flashing on and off in a regular or intermittent way so samely blinking effect is
used very rarely, as it is not eye soothing for users to watch a part of text
constantly turning on and off.
<!DOCTYPE html>
<html>
<body>
<button onclick=”CalenderFunction()">Put the date</button>
<script>
function CalenderFunction()n() {
var x = document.createElement("INPUT");
x.setAttribute("type", "date");
x.setAttribute("value", "2014-02-09");
document.body.appendChild(x);
</script>
</body>
</html>
63. How to add video in HTML?
</video>
<!DOCTYPE html>
<html>
<body>
function myMap() {
var mapProp= {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:5,
};
</script>
<script src="https://maps.googleapis.com/maps/api/js?
key=YOUR_KEY&callback=myMap"></script>
</body>
</html>
65. How to create registration form in HTML with database?
<form>
</form>
<div class="month">
<ul>
<li class="prev">❮</li>
<li class="next">❯</li>
<li>August<br><span style="font-size:18px">2017</span></li>
</ul>
</div>
<ul class="weekdays">
<li>Mo</li>
<li>Tu</li>
<li>We</li>
<li>Th</li>
<li>Fr</li>
<li>Sa</li>
<li>Su</li>
</ul>
<ul class="days">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li><span class="active">10</span></li>
<li>11</li>
</ul>
<!DOCTYPE html>
<html>
<head>
</head>
<noframes>
</noframes>
</frameset>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 35px;
height: 5px;
background-color: black;
margin: 6px 0;
</style>
</head>
<body>
<p>Menu icon:</p>
<div></div>
<div></div>
<div></div>
</body>
</html>
69. What is the difference between HTML tags and elements?
The starting and ending tags mark the beginning and end of the HTML
element. The tags are enclosed within the < and > symbol. HTML Elements is
the text written between HTML tags and it holds the content.
There are 6 types of headings that can be found in HTML which are numbered
<h1> to <h6> from largest to smallest. Headings are used in the following way.
To insert the copyright symbol you can use the “©” as well as “©” in
the HTML file.
72. How to specify the metadata in HTML?
<meta> is the tag used to specify metadata in HTML. <meta> is a void tag
which means there is no closing tag.
The block elements take up the full page width and start on a new line, instead
of inline element that only take the space to accommodate the length of the
content and continue on the same line. Some examples of block elements are
<div>, <p>, <header>, <footer>, <h1>…<h6>, <form>, <table>, <canvas>,
<video>, <blockquote>, <pre>, <ul>, <ol>, <figcaption>, <figure>, <hr>,
<article>, <section>, etc. Some examples of inline elements are <span>, <a>,
<strong>, <img>, <button>, <em>, <select>, <abbr>, <label>, <sub>, <cite>,
<abbr>, <script>, <label>, <i>, <input>, <output>, <q>, etc.
Audio tags are supported in HTML5 and with these, you can add audio to a
webpage. The file formats supported by HTML5 include MP3, WAV, and OGG.
To change the color of the bullet, you need to change the text color of the first
line in the list. The bullet takes the color from the first line of the list.
76. How can you keep list elements straight in an HTML file?
You can use indents to keep the elements of a list aligned straight. You can use
a nested list and indent them further than the parent list, you can quickly
determine the lists and elements contained under the list.
77. What are Forms in HTML?
If you want to collect the information of the visitors to the webpage, you can
add a form to the webpage. Once the user enters the information into the
form fields, it is added to a database specified by you.
Some elements in HTML only need an opening tag, without the need for a
close tag, and these are known as void elements. Some examples are <br />,
<img />, <hr />, etc.
A scrolling text that can go in a specific direction across the screen i.e. left,
right, up, or down, automatically. For this you can use the tag <marquee> Text
to scroll </marquee>.
Whenever you need to link any two web pages, website templates, or sections,
you can do so using the anchor tag. The anchor tag format is <a href=”#”
target=”link”></a>. Here the ‘link’ is defined as the target attribute, while the
‘href’ attribute indicates the sections in the documents.
Identified by the <map> tag, the image map can link an image to different web
pages. It is one of the most asked questions in interviews these days.
82. What is datalist tag?
The datalist tag is an HTML tag that lets the user auto-complete the form
based on the predefined options. It presents the users with predefined options
that they can choose from. An example of this can be as below:
<label>
<datalist id=”BolActor”>
</datalist>
</label>
It is an attribute that refers to one or more than one class name for an HTML
element. The class attribute can be used for the HTML elements.
The HTML figure tag is used for adding self-contained content such as
illustrations, photos, diagrams, or code listings. HTML figure tag contains two
tags such img src and figcaption. Img src is used for adding image source in a
document; while figcaption is used for setting caption to an image.
1. What is HTML5?
HTML5 is a markup language that is used to design the structural layout and
format of webpages in World Wide Web. It is the fifth and latest version of
HTML, hence it has a good lot of enhanced features and elements in its box for
the users and developers. HTML5 is used for designing web content like web
pages, sites, applications, advertisements, audio-video contents and games.
HTML5 has replaced Flash in a quite fast pace and allows to make highly
interactive ads and videos without requiring any external plugins, thus it can be
said that it has revolutionized the world of web.
HTML5 being the fifth and the last version of HML till now is much more
efficient and advanced as compared to HTML:
The main differences between the HTML4 and HTML5 are listed below:
HTML5 includes a lot of new features that are quite convenient to implement.
New inline elements of HTML5 indicate contents that are-
The new features of HTML5 that support making of more dynamic pages-
HTML5 does not support some elements of HTML4 like acronym, big, dir, etc.
HTML5 provides a few new elements like supporting drawing space in
JavaScript, adding audio and video to one’s web pages with simple tags.
Currently, latest versions of Apple Safari, Google Chrome, Opera and Mozilla
Firefox support many functionalities of HTML5. Internet Explorer 9.0 is also
intended to have support for HTML features. Besides, the mobile web
browsers that come pre-installed on Android phones, iPhones, and iPads, all
provide excellent support for HTML5.
Here are the steps to turn on HTML5 in Chrome by installing the extension
from Chrome Web Store (using IDE for example):
It has been quite long since Google proposed making HTML5 the default
language over Flash in Chrome, i.e. Chrome directly syncs to HTML5.
However, when it comes to Androids, one can always enable HTML5 in
Chrome by changing its settings.
No as such installation of HTML5 is required since almost all the modern day
web browsers support HTML5 by default. However, a proper text editor to
work with HTML5 (like in the case of HTML) is required to be installed on the
device, which can be done by directly downloading it from the browser. All the
HTML5 web contents are automatically supported by the web browsers;
hence no separate installation is needed to work on or with HTML5.
There are numerous reasons that point towards the benefits of using HTML5.
Be it for individual purposes or for business purposes, HTML5 is there to meet
its users’ needs and requirements.
More interactive: In this world of growing virtualization, high
interactivity is a must to have features. <canvas>, the HTML5 drawing
tag is used to create dynamic websites. Besides, it comes with a great
assortment of APIs, like Drag and Drop, offline storage database,
browser history management, document editing and timed playback
of media, to provide excellent user experience.
High accessibility: The Semantics and ARIA of HTML5 are the major
reasons behind the creation of highly accessible sites. Headings like
<header>, <section>, etc. are responsible for providing access to
different sections of a web page.
Doctype: Coding in HTML5 does not involve any kind of hustle and
bustle at all. Its doctype declaration is nevertheless pretty precise and
simple. Apart from the simplicity part, HTML5 runs in almost all the
web browsers.
Supports audio and video without external plugin: <video> and
<audio> tags of HTML5 enable its users to access audio and video
content without any third party plugin like Flash and Silverlight. These
tags use attributes like height, width, autoplay and so on to specify
the parameters of the audio/video.
Enhanced storage: The local and session storage of HTML5 provides a
smarter way of using the storage capacity efficiently. Local storage
makes the web applications possible without third party plugins.
Easy and clean coding: With a diversified set of attributes and tags, it
becomes very easy to code in HTML5. It allows writing clean and
descriptive codes with its semantic markup structure. Also, HTML5
boilerplate enables the designers to create webpages without facing
any hassle.
Wide browser support: All modern and popular web browsers such as
Chrome, Firefox, Opera, etc., all support HTML5. Now even IE
features tend to make use of some HTML5 functionality.
Game development: HTML5 provides an efficient way to develop
interactive games. <canvas> element plays an important role in game
development using HTML5.
Mobile friendly: Since mobile technology is ruling the world in the
current era, it is pretty much comprehensible for HTML5 to be mobile
friendly if it wants to lead the world of web.
In order to code in HTML5, begin with <!DOCTYPE HTML> in the text editor.
One can simply open the text editor and write the code for html5 like any
other html code, just to be kept in mind that one has to start with <!DOCTYPE
HTML>. Start with DOCTYPE, add <html> tag to specify the language, create
head section and body section as per your requirements and then save the file
with .htm extension.
<!DOCTYPE HTML>
<head>
<!-- basic.html -->
<title>basic.html</title>
</head>
<body>
<h1> Sample</h1>
<p>
</p>
</body>
</html>
Output:
<!DocTYpe html>, <!dOCtype html>, and <!doctype html>, are some other
declarations of DOCTYPE that are supported by HTML5.
In case one wants to turn off or disable HTML5 in one’s browse, one can easily
do so by going through the following procedure:
For YouTube(Chrome)
For Firefox
Go to about:config
Set media.ogg.enabled to false
There are several easy ways to download an HTML5 video, one of them are
mentioned here:
Open video downloader by clicking on +New Download button
Copy and paste of URL html5 video and further analyse it
Now choose the resolution and format as per your desire
Click on Download All button and download the HTML5 video in a go
The video technology of HTML5 empowers the marketers with the ability to
show up an engaging video experience on any platform virtually, no matter
whether it is an iPad or a Smartphone device or a web browser. HTML5 video
players provide a simpler way for marketers and digital agencies to embed
videos on websites or within different applications. There are certain HTML5
video players that make it pretty convenient to work with as well as build on
various HTML5 videos.
With new syntactical features and elements of HTML5, it becomes very easy
to integrate various multimedia and graphical contents without requiring Flash
and external plugins. Also, with its inbuilt features of adding audio and video,
we don’t require third party plugins while working with HTML5. Hence-
HTML5 ads are easy to update and do not need extra plugins
HTML5 ads essentially work with more platforms and browsers
HTML5 ads are much more interactive and engaging, henceforth
revolutionizing the world of digital marketing
External style sheets (CSS) can be easily linked to HTML5 by using the <link>
tag in the head section, which contains the link to the CSS code of the style
sheet. Consider the following example-
<!DOCTYPE html>
<head>
<title>CSSlink.html</title>
type = "text/css"
</head>
<body>
<h1>External Style Sheet</h1>
<p>
</p>
</body>
</html>
Output:
Apart from the above mentioned new form elements; there are a whole lot of
new form <input> elements as well-
21. What happens if you view a new HTML5 form input type in
an older browser?
Most of the web browsers( both new and old) are capable of handling HTML
elements as inline elements even when they are unrecognized as input
elements if a new HTML5 form input is viewed in it. Still, one can have the
browsers to identify and further handle the new form input types. While some
of the browsers ignore these new form elements and some might treat them as
errors, one needs to add CSS rules to the webpage, causing these elements to
behave like block elements in order to fix the compatibility issue.
{ display: block;}
Apart from this method, one can also rebuild the widgets with JavaScript to
make the elements familiar to the old browsers.
Earlier, <center> tag was used in HTML to center text. But, since this tag is a
deprecated HTML tag and no longer supported by HTML5, CSS text align
property or style attribute in HTML5 is applied to the desired <div> or <p>
element. Hence, text can be centered in HTML5 by applying text – align :
center to the desired text. However, their total dimensions remain the same.
CSS margin – right and margin – left properties can be used in HTML5 to
center the blocks as per one’s requirements.
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
</body>
</html>
T.blocktext {
margin-right: auto;
width: 10cm
...
Output:
To center an image in HTML5, style attribute with its value text – align : center
is used within a block level element like <p> … </p> tags.
Example:
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<p style="text-align:center;"><img
src="C:\Users\Lenovo\Desktop\great-learning-logo.png"
alt="Logo"></p>
</body>
</html>
Output:
Also, CSS properties can be used to center an image in HTML5. Consider the
following example using CSS alignment property:
IMG.DisplayLogo
{
display: block;
margin-left: auto;
margin-right: auto;
...
Canvas in HTML5 is an element that gives a very powerful and convenient way
to design graphics using JavaScript. <canvas> is used to draw charts, graphs,
compose photos and even carry out basic animations.
This <canvas> element has just additional width and height attributes along
with the core attributes like id, name, etc.
Example:
<!DOCTYPE HTML>
<html>
<head>
<style>
</style>
</head>
<body>
</body>
</html>
Output:
Initially the <canvas> element of HTML5 is blank and its rendering context is
needed to be accessed and drawn on it in order to display something. For that
matter, the rendering context of sample canvas in the above example has to be
created too.
Just like HTML5 is the fifth and the latest version of HTML, CSS is the third
and the latest version of CSS. HTML5 includes a number of advanced elements
to facilitate easy coding of web pages. Likewise, CSS3 encompasses the
concept of modules that aid efficient designing in less time. HTML5 contains
cascaded CSS3 to specify the style and structure of the site or app. HTML5
and CSS3 files are kept separated though.
Example:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<footer>
<div class="column">
<p>Company Info</p>
<ul style="list-style-type:disc">
<li>About Us</li>
</ul>
</div>
</footer>
</body>
</html>
Output:
A table is created using the <table> tag. Furthermore, <tr>, <th> and <td> tags
are used for specifying the table row, table headings and table data
respectively. Let’s consider the following example:
<!DOCTYPE html>
<html>
<head>
<title>Table</title>
</head>
<body>
<tr>
<td>row1,cell1</td>
<td>row1,cell2</td>
</tr>
<tr>
<td>row2,cell1</td>
<td>row2,cell2</td>
</tr>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Table</title>
</head>
<body>
<tr>
<td>row1,cell1</td>
<td>row1,cell2</td>
</tr>
<tr>
<td>row2,cell1</td>
<td>row2,cell2</td>
</tr>
</body>
</html>
Output:
30. Which tag represents an independent piece of content of a
document in HTML5?
Example:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2> HTML5</h2>
<h2>Python</h2>
</article>
</article>
</body>
</html>
Output:
The audio formats that are used to embed on a webpage are MP3, WAV, Ogg
Vorbis. WebM, MPEG4, Ogg video formats are used for embedding purposes
on a web page.
Raphael-Vector Graphics, Zoom plugin, Touch enabled SVG pan, jQuery inline,
SVG path animation plugin, iSVG are some of the jQuery SVG plugins required
in order to use the <svg> tags in HTML5.
By following the steps mentioned below, one can easily convert Flash to
HTML5:
For the conversion of PSD to HTML5, one has to go through the following
procedure:
Dividing the PSD file into chunks: Since a PSD file is too heavy and
static; it is not possible to export it directly to HTML5. Therefore, the
image file created in Photoshop has to be divided into sections like
header, body, navigation, or footer. It helps in coding that file in
HTML5
Coding for the file chunks in HTML5(conversion): Now, the segments
of PSD file need to be coded in the HTML5 mark-up language using
any good text editor. As the first step of coding, code the main work
and its background. In the next step, code the image navigation,
content area and footer section. While coding, take special care of the
navigation menu and the typography fonts.
SEO semantic Coding: The fundamentals of semantic coding in SEO
have to be kept in mind while conversion. Incorporation of ALT tags
along with descriptions of heading and meta tags as per requirement.
Test and Validation: A validation tool can be used to make this
process of test and validation of coding less time consuming.
HTML5 stack is a set of linked software technologies that aid in carrying out a
particular operation of a certain website or web application. The HTML5 stack
includes HTML5, CSS3 and JavaScript. This stack has predefined common
elements (including noscript and simple div) and attributes. Besides, there is a
choice of using one’s own set too; this feature makes the stack very flexible
and versatile.
Drag and Drop facility of HTML5 is one of its most essential features that are
responsible for an enhanced user interface. This feature allows the user to drag
an object from one place and drop it at the desired location with a simple
mouse click.
Move, copy and link are some of the common features that are used by most
of the Drag and Drop operations. In order to make an image draggable, one is
supposed to set the draggable image attribute to true, i.e., type = <img
draggable = “true”>. In this way, the Drag and Drop feature can be used for an
image.
38. What is the Geolocation API in HTML5 and how to use it?
Geolocation API is used for obtaining the user’s location for certain privacy
and security reasons. The navigator.geolocation.get current position() method
is used to get one’s location.
Example:
<!DOCTYPE html>
<html>
<head>
<title> location page</title>
</head>
<body>
<p id="location"></p>
<script>
var x = document.getElementById("location");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
function showPosition(position) {
</script>
</body>
</html>
Output:
HTML5 offline storage space mega browser (like Chrome) error can be cleared
by following the steps enlisted below:
HTML5 boilerplate which is now known to be one the most popular front-end
templates is used to build robust, adaptable and fast web sites and
applications. It offers a set of HTML5 in-built features and elements to help
the designers make efficient websites and applications in just no time. The very
basic features and elements to be found in HTML5 boilerplate cover almost all
the requirements needed to begin with any website designing. It supports
HTML, CSS, JavaScript, Crossdomain.xml, Apache web server
configuration(.htaccess) and other miscellaneous documentation like ignore
file, gitignore, etc.
HTML5 has been gaining popularity in developing games too. The steps to
make a game in HTML5 are as follows-
One can either use a dashboard template or go along with the conventional
way of coding for creating a dashboard in HTML5. First get the concept for
your dashboard then think about what all things you need to include. After
that, get started with a clean design of dashboard. Now, move on to the
development of your dashboard in which you are supposed to choose the
functional and the most visually compelling components of HTML5. It allows
you to produce a dynamic and descriptive representation of data. In the last
part, think about the deployment but thanks to HTML5 compatibility, it has got
you covered there.
You can check out the HTML5 course of The Great Learning Academy to learn
coding for the creation of a dashboard and get a better grasp on web
development.
So, these were the html5 interview questions that can help you have a fine
chance of qualifying your interview, but ultimately, the final results will be
governed by your depth of preparation and clarity of concept. Hope these
html5 interview questions will help you fetch good news for yourself! Best of
luck!
If you wish to learn more such concepts, you can join Great Learning
Academy’s free online courses and upskill today!
This brings us to the end of the blog on HTML Interview Questions and
HTML5 Interview Questions. We hope you are now well-equipped with the
kind of questions that may be asked during an Interview. Wondering where to
learn the highly coveted in-demand skills for free? Check out the courses
on Great Learning Academy.
TAGS
html
interview questions
Previous articleA beer crafted by AI and use of AI by Aditya Birla Sun Life AMC – Weekly guide
Tanuja Bahirat
Tanuja is a content writer who enjoys spending time in nature, watching football, and journaling. She
loves attending music festivals and reading. In her current journey, she writes about recent
advancements in technology and it's impact on the world.
RELATED ARTICLES
LEAVE A REPLY
Remember Me!
5 × 1 =
ABOUT US
Great Learning is an ed-tech company that offers impactful and industry-relevant programs in high-
growth areas. With a strong presence across the globe, we have empowered 20,000+ learners from
over 140+ countries in achieving positive outcomes for their careers. Know More
FOLLOW US