HTML Questions

Warm up for HTML questions with most asked questions and answers for junior, mid, and senior roles.

Senior

In how many ways you can display HTML elements?

Show Answer

There are four ways to display an HTML element.

1. Block

2. Inline

3. List

4. Table

Senior

What are logical and physical tags in HTML?

Show Answer

Physical Tags are used to indicate that how specific characters are to be formatted or indicated using HTML tags.

 

Logical tags are also known as structural tags that describe the behavior, nature of the content for the enclosed text.

Senior

What is difference between HTML and XHTML?

Show Answer

HTML is the standard markup language for creating web pages.

 

XHTML is a family of XML languages which extend or mirror versions of HTML.

 

It does not allow omission of any tags or use of attribute minimization. XHTML requires that there be an end tag to every start tag and all nested tags must be closed in the right order.

Senior

What are void elements in HTML?

Show Answer

A void element cannot have any content but may have attributes. Void elements are self-closing, so they must not have a closing tag.

Senior

What is the advantage of collapsing white space?

Show Answer

Collapsing white space is used to reduce the size of the web page.

Senior

When is it appropriate to use frames?

Show Answer

When you want to display multiple web pages on the same page.

Senior

What is an image map?

Show Answer
The tag defines an imagep map. An image map is a collection of areas on an image, that are clickable and link to a page.
Senior

What is semantic HTML?

Show Answer

Semantic HTML is a way to make the content of a web page more readable.

For example:

 

Senior

How do you keep list elements straight in an HTML file?

Show Answer

You can keep the list elements straight by using indents in an HTML file.

Senior

How many tags can be used to separate a section of texts?

Show Answer

There are 3 types of tags that can be used to separate a section of texts:

Senior

Can you create a multi-colored text on a web page?

Show Answer
Yes, to create text with different colors, use the tags for every character that you want to apply color.