Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
38 views

FAQ On HTML

Html files to interview
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

FAQ On HTML

Html files to interview
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

FAQ on HTML

15 Most Important HTML Interview Questions & Answers

1. What is HTML?

2. What is a Tag in HTML? Can you define HTML attributes?

3. What is the key difference between HTML Elements and Tags? Also, Can you
separate sections of texts in HTML?

4. If you want to display some HTML data in a table in tabular format, which HTML
tags will you use?

5. What are Attributes in HTML?

6. What is an Anchor tag in HTML?

7. What are Lists in HTML?

8. Define HTML Layout.

9. What are Forms in HTML?

10. What is the Use of Comments in HTML?

11. What is HTML5?

12. What is Semantic HTML?

13. What is an Image Map?

14. Why is the Embed Tag Used in HTML?

15. What is a ‘Marquee’ Tag in HTML?


1. What is HTML?

This is a common question, but some candidates think it is too basic to ask. This question is
used for gauging the basic understanding you have of HTML. Therefore, you must focus on
letting the interviewer know more than just a definition. Give insight into the full form of
‘HTML’ and then broadly explain the applications.

Answer:

HTML is the abbreviation for Hypertext Mark-up Language. It is the typical documents’
mark-up language for developing web pages to display on the web browser.

The extensions used to save HTML pages are .html and .htm.

2. What is a Tag in HTML? Can you define HTML attributes?

Answer:

In an HTML page, tags used are to place the content and format the pages. They always
defined between (<) and (>) symbols. For example, <h1>text</h1>.

An opening tag must be preceded with a closing tag and indicated with a ‘/’ symbol.

A tag instructs the browser to format the HTML. Tags have many uses, such as changing the
appearance of text, displaying a graphic, or linking another page. Coming to the other part
of the question, HTML attributes are properties you can add to an HTML tag. Such attributes
alter the way a tag behaves or the way it is displayed. For instance, <img> tag comes with an
src attribute that you use for adding image sources. We can add attributes after the name of
an HTML tag, within the brackets. Remember, we can add attributes to the opening and
self-closing tag only. No attributes are added to closing tags.

3. What is the key difference between HTML Elements and Tags? Also, Can you separate
sections of texts in HTML?

Answer:

This is one of the most asked HTML interview questions.

HTML Elements

The sections of the web page, such as a paragraph, an image, or a link is an element, and an
element has a certain way of execution. For example, the link is used to be clicked, and the
text boxes can be used to input text.
HTML Tags

HTML elements communicate with the browser how to represent the text and become
HTML tags when enclosed within angular brackets <>.

As for the latter part of the question, here is the answer. Yes, you can separate section of
texts in HTML with the following tags:

• <p> tag–Use this tag for writing a paragraph of any text.

• <br> tag – Use this for separating a line of text. This will break a current line and also
shift the flow of a text over to new line.

• <blockquote> tag–Use this tag to define any large quoted section.

4. If you want to display some HTML data in a table in tabular format, which HTML tags
will you use?

Answer:

The HTML has a specific tag, i.e., the table tag to display data in tabular form. Below is the
list of the HTML tags used to display data in tabular form in HTML:

Tag

Description

<table>

For defining a table.

<caption>

For mentioning a caption to the table.

<tr>

For defining a row in a table.

<td>

For defining a cell in a table.

<th>

For defining a header cell in a table.


<tbody>

For grouping the body’s content in a table.

<col>

For specifying the column properties for each column of the table.

5. What are Attributes in HTML?

Answer:

An additional attribute is given to each tag to alter the behavior of the tag. Attributes are
defined directly after the tag name, inside the angular brackets. They appear in opening tags
and can never appear in closing tags.

For example:

You can define an attribute for the <input> tag, such as a text field, checkbox, radio button,
or many more ways.

6. What is an Anchor tag in HTML?

Answer:

An anchor tag is used to link two sections, web pages, or website templates in HTML.

Its format is:

<a href=”#” target=”link”></a>

Where ‘href’ is an attribute of the anchor tag used to identify the sections in a document,
the ‘link’ is defined in the target attribute, which is to be linked.

7. What are Lists in HTML?

Answer:

HTML lists are used to group a set of related items in lists. It is defined with an <li> tag.

Some commonly used HTML lists:

• Ordered List (HTML tag: <ol>)

• Unordered List (HTML tag: <ul>)

• Description List (HTML tag: <dl>)


• Menu List (HTML tag: <menu>)

• Directory List (HTML tag: <dir>)

8. Define HTML Layout.

Answer:

An HTML web page is arranged in a specific layout (format). Here are the sections of an
HTML webpage to specify the different parts of a webpage:

The primary sections of the layout are:

• Header to define a document or a section header.

• Main content where the entire web page content is included.

• Footer to define a document or a section footer.

There are also sections such as articles and the navigation bar that are the parts of a layout.
9. What are Forms in HTML?

Answer:

Forms are used to collect the user information when they are filled, and details are provided
to save into the database.

10. What is the Use of Comments in HTML?

Answer:

Comments are used in an HTML document to make important notes and help developers
mention any modification to be incorporated afterward. They are not displayed in the
browser when the code is executed. A comment is always written in between the ‘—‘
symbol at the beginning and end of the angular brackets.

Syntax:

<!—‘Comment’ !–>
11. What is HTML5?

Answer:

HTML5 is the improved HTML version released in 2014 by the World Wide Web consortium.
Nowadays, every employer wants to put this as one of the HTML interview questions.

It has set forth the following new characteristics to be learned by professionals:

• DOCTYPE declaration: To declare the HTML document type to instruct the web
browser about the markup language.

• Main: The main tag defines the primary section in the document related to the
central content of a document with a <main> tag.

• Section: It is used to define specific sections in a document such as a chapter,


header, footer, or any other section, and is specified with the <section> tag.

• Header: The header tag defines the title or heading of a document or its section. It is
specified with the <header> tag.

• Footer: The footer tag defines the section of a document that contains information
such as copyright or author’s information. It is designated with the <footer> tag.

• Article: The article tag represents an independent or self-contained part of the


content of a document with the tag <article>.

12. What is Semantic HTML?

Answer:

Semantic HTML is one style of coding, where the tags convey the meaning of the text. HTML
uses semantics to reinforce the semantics or purpose of the content.

For Example:

<b> </b> and <i> </i> tags which are used to bold and italic statements in HTML are
replaced with <strong></strong> and <em></em> tags in semantic HTML.

This is because they represent formatting and provide no meaning or structure.


13. What is an Image Map?

Answer:

An Image map lets you link different web pages with a single image. It is represented with
the <map> tag. Every employer expects the applicant to know about this, and this has been
one of the most commonly asked HTML interview questions.

14. Why is the Embed Tag Used in HTML?

Answer:

An Embed Tag is used for including a Video or Audio in an HTML Document. A source of
audio or video file to be displayed on the webpage is defined within an Embed tag as:

<EMBED> Source </EMBED>.

15. What is a ‘Marquee’ Tag in HTML?

Answer:

You can put scrolling text with a Marquee tag. With the help of this tag, an image or text can
be scrolled up, down, left, or right.

The text which is scrolled is defined within the <marquee>……</marquee> tag.

16. How to create a hyperlink in HTML?

The HTML provides an anchor tag to create a hyperlink that links one page to another page.
These tags can appear in any of the following ways:

o Unvisited link - It is displayed, underlined and blue.

o Visited link - It is displayed, underlined and purple.

o Active link - It is displayed, underlined and red.

You might also like