0% found this document useful (0 votes)
11 views10 pages

HTML Interview Questions and Answers

Uploaded by

kumarigorla09
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)
11 views10 pages

HTML Interview Questions and Answers

Uploaded by

kumarigorla09
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

Famous Interview Question’s with Answers

What does HTML stand for?

a) Hyperlinks and Text Markup Language

b) Home Tool Markup Language

c) Hyper Text Markup Language

d) Hyperlink Text Markup Language

Answer: c) Hyper Text Markup Language

Which tag is used to create a hyperlink in HTML?

a) <a>

b) <link>

c) <h1>

d) <img>

Answer: a) <a>

What is the correct HTML tag for inserting a line break?

a) <br>

b) <lb>

c) <break>

d) <newline>

Answer: a) <br>

How can you make a bulleted list in HTML?

a) <ul>

b) <ol>

c) <li>
d) <nl>

Answer: a) <ul>

What is the purpose of the <div> tag in HTML?

a) It defines a division or a section in an HTML document.

b) It represents an image in the document.

c) It defines a hyperlink.

d) It is used for styling text.

Answer: a) It defines a division or a section in an HTML document.

Which attribute is used to specify the URL of the linked resource in the <a> tag?

a) src

b) href

c) alt

d) link

Answer: b) href

How can you add comments in HTML?

a) <!-- comment -->

b) // comment

c) /* comment */

d) // comment //

Answer: a) <!-- comment -->

What is the purpose of the <form> tag in HTML?

a) It is used to create a table.

b) It defines a paragraph in an HTML document.

c) It represents a form for user input.

d) It defines a section in an HTML document.

Answer: c) It represents a form for user input.


What is the correct HTML tag for inserting a line break?

a) <break>

b) <lb>

c) <br>

d) <newline>

Answer: c) <br>

Which tag is used to create a table in HTML?

a) <table>

b) <tr>

c) <td>

d) <th>

Answer: a) <table>

What is the purpose of the <img> tag in HTML?

a) It is used to display images on a web page.

b) It represents a link to an external CSS file.

c) It defines a paragraph in an HTML document.

d) It is used to create a hyperlink.

Answer: a) It is used to display images on a web page.

How can you make a text input field in HTML?

a) <input type="text">

b) <text>

c) <textfield>

d) <input field="text">

Answer: a) <input type="text">

What is the correct HTML tag for the largest heading?

a) <h1>

b) <h6>
c) <heading>

d) <title>

Answer: a) <h1>

Which attribute is used to specify an alternate text for an image if it cannot be displayed?

a) src

b) alt

c) href

d) title

Answer: b) alt

How can you create a horizontal rule in HTML?

a) <hr>

b) <rule>

c) <line>

d) <hrule>

Answer: a) <hr>

What is the purpose of the <textarea> tag in HTML?

a) It is used to display formatted code on a web page.

b) It represents a text input field.

c) It is used to create a drop-down list.

d) It is used to create a multi-line text input field.

Answer: d) It is used to create a multi-line text input field.

Which tag is used to define the main heading of a web page?

a) <head>

b) <title>

c) <h1>

d) <main>

Answer: c) <h1>
How can you create an unordered list in HTML?

a) <ol>

b) <ul>

c) <li>

d) <ul>

Answer: b) <ul>

What is the purpose of the <span> tag in HTML?

a) It is used to apply styles or manipulate specific sections of text.

b) It represents a line break in an HTML document.

c) It is used to display images.

d) It defines a hyperlink.

Answer: a) It is used to apply styles or manipulate specific sections of text.

Which attribute is used to specify the target URL for a hyperlink?

a) src

b) href

c) alt

d) target

Answer: b) href

What is the purpose of the <head> tag in HTML?

a) It defines the main content of the web page.

b) It contains metadata about the web page.

c) It represents a section in an HTML document.

d) It is used to insert JavaScript code.

Answer: b) It contains metadata about the web page.

Some More Questions

What does HTML stand for?


a) Hyper Text Markup Language

b) Home Tool Markup Language

c) High Tech Markup Language

d) Hyperlink and Text Markup Language

Answer: a) Hyper Text Markup Language

Which tag is used to define the document type in HTML5?

a) <html>

b) <head>

c) <doctype>

d) <title>

Answer: c) <doctype>

Which tag is used to define the title of an HTML document?

a) <h1>

b) <title>

c) <head>

d) <body>

Answer: b) <title>

What is the correct way to create a hyperlink in HTML?

a) <a href="#">Link</a>

b) <link>

c) <a src="#">Link</a>

d) <hyperlink>Link</hyperlink>

Answer: a) <a href="#">Link</a>

Which attribute is used to specify the URL of the linked document in the <a> tag?

a) src

b) href

c) link
d) url

Answer: b) href

Which tag is used to create a numbered list in HTML?

a) <ol>

b) <ul>

c) <li>

d) <list>

Answer: a) <ol>

What is the correct way to create a table in HTML?

a) <table>

b) <tr>

c) <td>

d) All of the above

Answer: d) All of the above

Which tag is used to define a section in HTML5?

a) <section>

b) <div>

c) <span>

d) <article>

Answer: a) <section>

Which tag is used to display an image in HTML?

a) <image>

b) <picture>

c) <img>

d) <src>

Answer: c) <img>
What is the correct way to create a line break in HTML?

a) <lb>

b) <break>

c) <br>

d) <newline>

Answer: c) <br>

Which tag is used to define a horizontal rule in HTML?

a) <rule>

b) <hr>

c) <line>

d) <horizontal>

Answer: b) <hr>

Which attribute is used to specify the width of an image in HTML?

a) width

b) size

c) length

d) scale

Answer: a) width

Which tag is used to define a form in HTML?

a) <form>

b) <input>

c) <submit>

d) <button>

Answer: a) <form>

What is the correct way to create a checkbox in HTML?

a) <input type="checkbox">

b) <checkbox>
c) <input type="check">

d) <input="checkbox">

Answer: a) <input type="checkbox">

Which attribute is used to specify the type of input in an <input> tag?

a) type

b) input-type

c) input

d) input-type

Answer: a) type

What is the correct way to create a radio button in HTML?

a) <input type="radio">

b) <radio>

c) <input type="button">

d) <input="radio">

Answer: a) <input type="radio">

Which tag is used to define a heading in HTML?

a) <h1>

b) <heading>

c) <header>

d) <head>

Answer: a) <h1>

What is the correct way to create a hyperlink that opens in a new tab?

a) <a href="#" target="_blank">Link</a>

b) <a href="#" target="new">Link</a>

c) <a href="#" target="tab">Link</a>

d) <a href="#" target="blank">Link</a>

Answer: a) <a href="#" target="_blank">Link</a>


Which attribute is used to specify the background color of an element in HTML?

a) bgcolor

b) background-color

c) color

d) style

Answer: b) background-color

What is the correct way to create a comment in HTML?

a) <!-- This is a comment -->

b) <!-- Comment -->

c) <comment>This is a comment</comment>

d) <!Comment>

Answer: a) <!-- This is a comment -->

You might also like