HTML interview questions
HTML interview questions
doesn't offer dynamic functionality. Some of its use cases include web
development, internet navigation, and web documentation. For both
the applicant and the interviewer it is essential to go through the
typical questions revolving around its concepts and use cases to
develop a command over HTML. Apply now
Advanced
This HTML interview
website utilizes questions
technologies such as and answers
cookies (30)
to enable essential site functionality, as well as for
analytics, personalization, and targeted advertising purposes. You may change your settings at any time Save
or accept the default settings. You may close this banner to continue with only essential cookies.
Privacy Policy Accept All
BASIC
Storage HTML INTERVIEW
Preferences QUESTIONS AND ANSWERS
Reject All
Targeted Advertising Personalization Analytics
1. How do you add comments in HTML?
Hide Answer
To insert a comment in HTML you can simply use the lesser than
sign at the beginning and the greater than sign at the end like this:
“<!- comment ->”.
Hide Answer
Physical tags format and display the content inserted within the
tags. They add style defined by the parameters while logical tags
define the meaning or structure of the content within the tags.
Hide Answer
Hide Answer
Hide Answer
Tags are elements in HTML that define and format content properly.
Hide Answer
No, not all tags need to be closed. There are self-closing tags such
as , that don’t require closing tags.
Hide Answer
There are two HTML tags you can use to make sections or
paragraphs:
- This is used to create a line to separate text.
- This is used to create a text paragraph
Hide Answer
Hide Answer
Hide Answer
Hide Answer
You can underline text by simply using the tag.
Hide Answer
An image map is used for linking multiple web pages using a single
image by using the tag. One can define the kind of shapes one
wants to include in images.
Hide Answer
Hide Answer
<head>
<title>Page title</title>
</head>
<body>Body of contents</body>
</html>```
Hide Answer
You can use hyperlinks in text and images. The “href” attribute is the
most commonly used to define HTML anchor tags.
Example:
Hide Answer
DOM is short for Document Object Model. DOM defines the following:
Hide Answer
You can insert an image by using the tag. Certain parameters are
required for inserting images:
Example:
Hide Answer
Hide Answer
Marquee is used for scrolling text on a web page. By using the tag,
one can scroll either left, right, down, or up automatically.
Hide Answer
Hide Answer
You can add a button to an HTML page by using the button tag:
22. What are the types of headings you can use for your
HTML doc?
Hide Answer
There are about 5 types of headings that can be used. They can be
defined by the following tags:
Hide Answer
Hide Answer
Yes, you can change the font color by using the tag. For example;
Hide Answer
There are three types of CSS elements that can be included. These
are:
Internal CSS - This is used for adding tags in the section of the
document. It is mainly for styling a single page that has a unique
style.
Hide Answer
The default size for a text field is about 20 characters long. But if you
include the size attribute one can set the size value to be as low as 1
and as high as the width of the browser width.
27. List the tags used to display data in the tabular form.
Hide Answer
- defines a table
Hide Answer
Every webpage has a specific layout but the following tags and
elements are used in defining different sections of a webpage:
29. Is a tag?
Hide Answer
No, the is not a tag but a declaration. With it, HTML tags cannot
function properly.
Hide Answer
The default for any link is blue. Once it has been clicked on, it turns
purple.
Hide Answer
In style sheets, the style tag takes priority, and external style sheets
take the least priority.
2. What is SVG?
Hide Answer
Hide Answer
Hide Answer
Hide Answer
Hide Answer
To open a CSS extension file, one needs to use the tag. This will
reference the CSS file.
Hide Answer
Hide Answer
Yes, you can use the following syntax to create different multi-
colored texts.
Hide Answer
Frames make page navigation easier. If the links of the page are
placed under frames, they will appear at the top of the page or at
the bottom of the browser.
10. How can you send mail directly from the webpage?
Hide Answer
One can easily create a clickable link text by using the “mailto”
command within the href tag as follows:
Hide Answer
You can insert a copyright symbol by using the © to any HTML
document.
Hide Answer
Yes, this can be easily done by using the tag along the referencing
symbol #. This will create different links within the same web page
Hide Answer
Hide Answer
Hide Answer
When you overlap two or more sets of tags, the first tag will be
recognized. This will cause problems and lead to web browser not
interpreting the page correctly thus causing inconsistencies on the
web page.
17. Define applets
Hide Answer
Applets are small programs that are embedded within web pages.
They perform different functions such as animations,
computations, and information processing.
Hide Answer
Simplified processing
Improved organization
Consistency
Hide Answer
Hide Answer
Hide Answer
Hide Answer
The tag is used to define the script for the client side.
Hide Answer
Yes, this can happen when the width of the defined table is wider
than the browser's width.
Hide Answer
Yes, the color for bullets can be changed by customizing them into
a different color using CSS.
Hide Answer
You can define the color for table borders in the style sheet. If this is
not supported the text color will be used instead.
Hide Answer
When the border attribute is set to zero, the default cell borders and
thickness will be applied, whereas if a rule attribute is added to a
tag, the border attribute will not be included. The default one-pixel
border will be shown instead.
<!DOCTYPE html>
<html>
<body>
<h2>Nested example</h2>
<p>Use the height and width attributes to specify the size of
the iframe:</p>
<iframesrc="https://link/"height="500"width="600"></iframe>
</body>
</html>
Hide Answer
Hide Answer
Hide Answer
Hide Answer
Hide Answer
Yes, but you would need to embed the geolocation API to your HTML
document for accessing the geographic location of a user in HTML.
Hide Answer
Hide Answer
Hide Answer
GET method is used for requesting data from a server, while the
POST method is used to send data to a server.
Hide Answer
Hide Answer
A box model provides the description for how elements are sized
and displayed on the page. Each page may have a width, height,
padding, borders, and margins. This is related to the CSS styling
property.
Hide Answer
The tag is used for embedding image, video or audio files inside an
HTML document. This tag requires a closing tag.
Looking for remote developer job
at US companies?
Work at Fortune 500 companies and Apply Now
fast-scaling startups from the comfort
of your home
Hide Answer
Hide Answer
<!DOCTYPE html>
<html>
<head>
<style>
div.ex1 {
background-color: light-green;
width: 110px;
height: 110px;
overflow: scroll;
}
</style>
</head>
<body>
<h2>scroll:</h2>
<div class="ex1">Congratulations, this is how you create a
scroll bar.</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color: lightblue;
width: 300px;
border: 15px green;
padding: 50px;
margin: 20px;
}
</style>
</head>
<body>
<p>Welcome.</p>
</body>
</html>
Hide Answer
Hide Answer
An anchor tag is used to link two or more web pages together using
the tag.
Hide Answer
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-
scale=1">
<style>
div {
width: 35px;
height: 5px;
background-color: black;
margin: 6px 0;
}
</style>
</head>
<body>
<p>Menu:</p>
<div></div>
<div></div>
<div></div>
</body>
</html>
Hide Answer
Hide Answer
<!DOCTYPE html>
<html>
<body>
<form>
Username:
<br>
<input type="text"
name="username">
<br>
Email id:
<input type="text"
name="email_id">
<br>
<input type="submit"
value="Submit">
</form>
</body>
</html>
Void elements are elements that have only the start tags and don’t
contain any content within them.
Hide Answer
</select>
Hide Answer
Yes, you can change the inline element to a block element by using
the display property and setting the value to block. Example:
Hide Answer
Hide Answer
The lang attribute is used to specify the language used to write the
content of a web page. For example: or
Hide Answer
Hide Answer
Hide Answer
Hide Answer
Hide Answer
<!DOCTYPE html>
<html>
<head>
<style>
Body {
background-color :yellow;
}
</style>
</head>
<body>
</body>
</html>
Hide Answer
<p>Code example:</p>
<pre><code>var person = {
firstName:"John",
lastName:"Doe"
}</code></pre>
Hide Answer
<body>
<p id="demo">Example.</p>
<script>
document.getElementById("demo").style.fontSize = "60px";
</script>
</body>
Hide Answer
Hide Answer
Hide Answer
Yes, you can link CSS to HTML5 by using the tag in the header
section.
Hide Answer
Yes, HTML5 has a player that has the ability to show engaging
videos on any platform.
25. List the new form elements that are now available in
HTML5.
Hide Answer
These are:
Hide Answer
- to strikethrough a text
Hide Answer
SVG is easy to scale, can be edited in any text editor, and the image
quality is high no matter what the resolution is.
Hide Answer
Since the tag is deprecated, you can use the CSS text-align
property to the desired element.
Hide Answer
Hide Answer
<!DOCTYPE html>
<html>
<head>
<title> location page</title>
</head>
<body>
<p>Click this button below to get your location.</p>
<button onclick="getLocation()"> My Location </button>
<p id="location"></p>
<script>
var x = document.getElementById("location");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this
browser.";
}
}
function showPosition(position) {
x.innerHTML = "At Latitude: " + position.coords.latitude +
"<br>At Longitude: " + position.coords.longitude;
}
</script>
</body>
</html>
CONCLUSION
With this comprehensive list of questions, both the interviewers and the
interviewee can have a quick reference to intermediate and advanced
levels of HTML questions.
If you are a new hirer looking for alternative methods of hiring, you can
opt for Turing. The company helps you hire the world’s best talent
remotely. For developers looking for HTML jobs, Turing test is the route
to go!
Search skills... |
PHP
Hire Developers
Help center
On-demand
talent
Technical
professionals and
teams
Sitemap Terms of service Privacy policy Privacy settings