0% found this document useful (0 votes)
3 views1 page

HTML Interview Questions and Answers

The document provides a series of HTML interview questions and answers covering topics such as nesting web pages with <iframe>, the role of tags and attributes, void elements, the advantage of collapsing whitespace, and HTML entities. It explains how tags structure content and attributes define element characteristics. Additionally, it lists examples of reserved characters and their corresponding HTML entities.

Uploaded by

achu 3494
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

HTML Interview Questions and Answers

The document provides a series of HTML interview questions and answers covering topics such as nesting web pages with <iframe>, the role of tags and attributes, void elements, the advantage of collapsing whitespace, and HTML entities. It explains how tags structure content and attributes define element characteristics. Additionally, it lists examples of reserved characters and their corresponding HTML entities.

Uploaded by

achu 3494
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

HTML Interview Questions and Answers

1. Can we display a web page inside a web page or Is nesting of webpages possible?

Yes, we can display a web page inside another HTML web page. HTML provides a tag <iframe> using
which we can achieve this functionality.

<iframe src=”url of the web page to embed” />

2. What are tags and attributes in HTML?

Tags are the primary component of the HTML that defines how the content will be structured/
formatted, whereas Attributes are used along with the HTML tags to define the characteristics of the
element. For example, <p align=” center”>Interview questions</p>, in this the ‘align’ is the attribute
using which we will align the paragraph to show in the center of the view.

3. What are void elements in HTML?

HTML elements which do not have closing tags or do not need to be closed are Void elements. For
Example <br />, <img />, <hr />, etc.

4. What is the advantage of collapsing white space?

In HTML, a blank sequence of whitespace characters is treated as a single space character, Because
the browser collapses multiple spaces into a single space character and this helps a developer to
indent lines of text without worrying about multiple spaces and maintain readability and
understandability of HTML codes.

5. What are HTML Entities?

In HTML some characters are reserved like ‘<’, ‘>’, ‘/’, etc. To use these characters in our webpage
we need to use the character entities called HTML Entities. Below are a few mapping between the
reserved character and its respective entity character to be used.

Character Entity Name Entity Number

< &lt; &#60;

> &gt; &#62;

& &amp; &#38;

(non-breaking space) Eg. 10 PM&nbsp; Eg. <p>10&nbsp&nbspPM</p> &#160;

You might also like