HTML Interview Questions and Answers
HTML interview questions and answers are entirely based on core concepts of HTML and
related topics.
What is HTML?
HTML is the short form of Hypertext Markup Language. HTML is used to design and
display pages on the web. It makes the text content more attractive and dynamic. We can
create tables, add images, videos, links in our text. We can also add animation to our page to
make it more attractive. Every HTML page starts with <html> tag and end with </html> tag.
It has two main parts head section and body section.
Which HTML tags don't have an end tag?
There are some HTML tags that don't have closing tag like <br>, <hr>, <input> and <image>
tag.
What do you mean by HTML tags?
Html tags have the following format:
An opening tag - content - closing tag
Some tags don't have a closing tag. HTML tags are main part of HTML. We can create
HTML documents and render their properties with HTML tags and properties may differ for
different tags.
Syntax
<tag> Text content </tag>
Explain different heading types?
There are six different heading types defined with <h1> to <h6> tags. Each heading tag
displays the content with different size. <h1> tag is the largest heading tag and <h6> is the
smallest heading tag.
Example:
<h1>Title 1</h1>
<h2>Title 2</h2>
<h3>Title 3</h3>
<h4>Title 4</h4>
<h5>Title 5</h5>
<h6>Title 6</h6>
, How to differentiate HTML elements and HTML tags?
When we form HTML tag HTML elements are enclosed by brackets <> . HTML elements
are used to communicate with a browser and to render text. Most of HTML tags are in pairs,
and they cover the text.
Describe semantic HTML?
It is coding style that we can use to reinforce the meaning of the content. For example In
semantic HTML we use <strong> </strong> tag for bold statement as well as <em> </em>
tag for italic statement insted of using <b> </b> and <i></i> tags.
Explain an image map.
We can link many different web pages using a single image in the Image map. We can also
define shapes in images that you want to take part in an image mapping. It is represented by
<map> tag.
How to create a nested webpage in HTML?
We can use the iframe tag to represent a webpage within a webpage. It defines an inline
frame on the HTML page.
Syntax
<figure><iframe src="URL of page"></iframe></figure>
Here in src, we write the URL of the page which we want to use as a subpage.
Example
<html>
<body>
<h2>HTML Iframe example</h2>
<p> We can use the height and width attributes to specify the size
of the iframe:</p>
<iframe src="https://www.errorsea.com/" height="300"
width="400"></iframe>
</body>
</html>
How to insert a copyright symbol on a browser page?
You can insert a copyright symbol by using © or © in an HTML file.
A hyperlink only applies to text, if no, then why?
No, you can apply hyperlinks on text and images both. The HTML <a> tag defines a
hyperlink that links one page to another page. We must use the "href" attribute in <a> tag to
generate a hyperlink.
HTML interview questions and answers are entirely based on core concepts of HTML and
related topics.
What is HTML?
HTML is the short form of Hypertext Markup Language. HTML is used to design and
display pages on the web. It makes the text content more attractive and dynamic. We can
create tables, add images, videos, links in our text. We can also add animation to our page to
make it more attractive. Every HTML page starts with <html> tag and end with </html> tag.
It has two main parts head section and body section.
Which HTML tags don't have an end tag?
There are some HTML tags that don't have closing tag like <br>, <hr>, <input> and <image>
tag.
What do you mean by HTML tags?
Html tags have the following format:
An opening tag - content - closing tag
Some tags don't have a closing tag. HTML tags are main part of HTML. We can create
HTML documents and render their properties with HTML tags and properties may differ for
different tags.
Syntax
<tag> Text content </tag>
Explain different heading types?
There are six different heading types defined with <h1> to <h6> tags. Each heading tag
displays the content with different size. <h1> tag is the largest heading tag and <h6> is the
smallest heading tag.
Example:
<h1>Title 1</h1>
<h2>Title 2</h2>
<h3>Title 3</h3>
<h4>Title 4</h4>
<h5>Title 5</h5>
<h6>Title 6</h6>
, How to differentiate HTML elements and HTML tags?
When we form HTML tag HTML elements are enclosed by brackets <> . HTML elements
are used to communicate with a browser and to render text. Most of HTML tags are in pairs,
and they cover the text.
Describe semantic HTML?
It is coding style that we can use to reinforce the meaning of the content. For example In
semantic HTML we use <strong> </strong> tag for bold statement as well as <em> </em>
tag for italic statement insted of using <b> </b> and <i></i> tags.
Explain an image map.
We can link many different web pages using a single image in the Image map. We can also
define shapes in images that you want to take part in an image mapping. It is represented by
<map> tag.
How to create a nested webpage in HTML?
We can use the iframe tag to represent a webpage within a webpage. It defines an inline
frame on the HTML page.
Syntax
<figure><iframe src="URL of page"></iframe></figure>
Here in src, we write the URL of the page which we want to use as a subpage.
Example
<html>
<body>
<h2>HTML Iframe example</h2>
<p> We can use the height and width attributes to specify the size
of the iframe:</p>
<iframe src="https://www.errorsea.com/" height="300"
width="400"></iframe>
</body>
</html>
How to insert a copyright symbol on a browser page?
You can insert a copyright symbol by using © or © in an HTML file.
A hyperlink only applies to text, if no, then why?
No, you can apply hyperlinks on text and images both. The HTML <a> tag defines a
hyperlink that links one page to another page. We must use the "href" attribute in <a> tag to
generate a hyperlink.