0% found this document useful (0 votes)
129 views

HTML

Uploaded by

swarnahr2000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
129 views

HTML

Uploaded by

swarnahr2000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

INTERVIEW QUESTIONS ON HTML

KODNEST®

ABOVE DOMINO’S PIZZA, 2ND FLOOR OPP GANGOTRI RESTAURANT AND UCO BANK, 8TH CROSS RD,
MARUTI NAGAR, BTM 1ST STAGE, BENGALURU, KARNATAKA 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

1. What is HTML?
HTML is the abbreviation for Hypertext Markup Language. It is
the typical documents markup 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?


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.

3. What is the key difference between HTML elements


and tags?

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 <>.

Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

4. If you want to display some HTML data in a table in


tabular format, which HTML tags will you use?

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?
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.

Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

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?
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?
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.


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:

Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

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?


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?


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’ !–>

Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

11. What is HTML5?


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?
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.

Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

13. What is an Image Map?


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?


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?


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.

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:

• Unvisited link – It is displayed, underlined and blue.


• Visited link – It is displayed, underlined and purple.
• Active link – It is displayed, underlined and red.

The syntax of Hyperlink in HTML is:

1 <a href = "..........."> Link Text </a>

17. What are the tags used to separate a section of texts?


There are three tags that can be used to separate the texts:

• <br> tag – Usually <br> tag is used to separate the line of


text. It breaks the current line and conveys the flow to the
next line
• <p> tag – This contains the text in the form of a
new paragraph.

Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

• <blockquote> tag – It is used to define a large quoted


section. If you have a large quotation, then put the entire
text within <blockquote>……….</blockquote> tag.

18. What is the difference between DIV and SPAN in HTML?


The difference between span and div is that a span element is in-
line and usually used for a small chunk of HTML inside a line,such
as inside a paragraph. Whereas, a div or division element is block-
line which is equivalent to having a line-break before and after it
and used to group larger chunks of code.

Example:

<div id="HTML">
This is <span class="Web Dev">interview</span>
</div>
19. Is the <!DOCTYPE html> tag considered as a HTML tag?
No, the <!DOCTYPE html> declaration is not an HTML tag. There
are many type of HTML, such as, HTML 4.01 Strict, HTML 4.01
Transitional, HTML 4.01 Frameset, XHTML 1.0 Strict, XHTML 1.0
Transitional, XHTML 1.0 Frameset, XHTML 1.1 etc. So, <!DOCTYPE
html> is used to instruct the web browser about the HTML page.

20. What is the use of a span tag? Explain with example.


The span tag is used for the following things:

• For adding color on text


• To add background on text
• Highlight any color text

<span style="color:#ffffff;">
In this page we use span.
</span>

21. What are paired and unpaired tags?


Paired tags are a set of two tags with the same name. In
each Paired tag set, one is an opening tag, and the other
one is the closing tag. The closing tag has a / slash, it
means that the tag is closed now.
Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

Unpaired tags are single tags with no closing tag. These


tags are also called Singular Tags. These are also
called non-container tags because they do not contain any
content.
22. What is the structure of HTML?
All the content of a web page is displayed using the tags. Tags used
in a HTML document can be paired and unpaired. Following is an
example of basic structure of a HTML document

23. What is the role of HTML interpreter?


HTML interpreter is similar to normal interpreter, but no
conversion of code happens. Based on the tags it will point to
respective regions in the webpage.

24. How many heading tags are present in HTML?

An HTML heading tag is used to define the headings of a


page. There are six levels of headings defined by HTML.
These 6 heading elements are H1, H2, H3, H4, H5, and H6;
with H1 being the highest level and H6 the least.

Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

25. Describe some of the basic tags in HTML.

26. What are formatting tags?

HTML Formatting is a method of text formatting for a better


appearance and look. HTML allows us to format text without
using the CSS. HTML includes a lot of formatting tags. These
tags are used to make bold, underline, and italic text. There
are nearly 14 options available in HTML and XHTML for the
way text appears.
For HTML the tags are divided into two categories:
• Physical tag
• Logical tag
Physical tag: These tags are used to give the text a visual
appearance.

Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

Logical tag: Logical or semantic tags are used to append the


value.

Element
Description
name
<b> It is a physical tag used to bold the text between the tags.

<strong> It is a logical tag that tells the browser that text is important.
<i> It is a physical tag used to make italic text.

<em> It is a logical tag used to display the content in italics.

<mark> This tag will be used to highlight the text.

<u> This tag is used to underline the text that has been written between them.

<tt> Use this tag, a text may appear in a teletype. (Doesn’t support HTML5)

<sup> It displays the contents just slightly above the usual line.

<sub> It displays the contents just slightly below the usual line.

<del> It tag is used to display the deleted contents.

Using this tag will draw a strikethrough on a text line. (Don't support
<strike> HTML5)

<ins> This tag shows the added contents.

<big> This tag is used with one conventional unit to increase font size.

<small> This tag is used to reduce font size by one unit from the base font size.

Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

27. Describe unordered lists and the tags used in it.


An unordered list starts with the <ul> tag. Each list item
starts with the <li> tag. Where <ul> stands for unordered
list and <li> is a tag which contains list items. The list
items will be marked with bullets (small black circles) by
default.
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>

28. Describe ordered lists and the tags used in it.


The HTML <ol> tag defines an ordered list. An ordered list
can be numerical or alphabetical. An ordered list starts
with the <ol> tag which stands for ordered list. Each list
item starts with the <li> tag which contains the list items.
The list items will be marked with numbers by default.
<ol>
<li>Learn</li>
<li>Practice</li>
<li>Implement</li>
</ol>

29. Describe description lists and the tags used in it.


A description list is a list of terms, with a description of each term.
The <dl> tag defines the description list, it is used in conjunction
with the <dt> tag that defines the term (name), and the <dd> tag
that describes each term.
<dl>
<dt>HTML</dt>
<dd>- Used to display the content</dd>
<dt>CSS</dt>
<dd>- Gives design to the content and enhance the appearance</dd>
</dl>

Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068
HTML INTERVIEW QUESTIONS www.kodnest.com Phone No: 8095000123

30. What is the difference between bold and strong tag and
italics and emphasis tag?
• Bold tag vs strong tag
The text written under <b> tag makes the text bold
presentationally to draw attention. The main difference between
these two tags is that the strong tag semantically emphasizes on
the important word or section of words while the bold tag is just
offset text conventionally styled in bold.
• Italics tag vs emphasis tag
The main difference between these two tags is that the <em> tag
semantically emphasizes on the important word or section of
words while <i> tag is just offset text conventionally styled in italic
to show alternative mood or voice.

Above Domino’s Pizza, 2nd floor opposite Gangotri Rest. 8th cross Rd, Maruti Nagar, BTM Layout 1,
Bengaluru, Karnataka – 560068

You might also like