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

HTML MCQ

The document contains a series of questions and answers related to HTML and CSS, covering topics such as HTML tags, attributes, and syntax. It includes questions about creating hyperlinks, formatting text, and using various HTML elements. The document serves as a quiz or study guide for understanding HTML and web development concepts.

Uploaded by

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

HTML MCQ

The document contains a series of questions and answers related to HTML and CSS, covering topics such as HTML tags, attributes, and syntax. It includes questions about creating hyperlinks, formatting text, and using various HTML elements. The document serves as a quiz or study guide for understanding HTML and web development concepts.

Uploaded by

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

1. What does HTML stand for?

a) Hyper Transfer Markup Language


b) Hyper Text Markup Language
c) High Text Machine Language
d) Hyperlink Text Marking Language
Answer: b) Hyper Text Markup Language
2. Which of the following is used to create a hyperlink in HTML?
a) <a>
b) <link>
c) <href>
d) <hyper>
Answer: a) <a>
3. What is the correct syntax for an HTML comment?
a) /* This is a comment */
b) // This is a comment
c) <!-- This is a comment -->
d) # This is a comment
Answer: c) <!-- This is a comment -->
4. Which HTML tag is used to display a numbered list?
a) <ul>
b) <ol>
c) <li>
d) <dl>
Answer: b) <ol>
5. Which tag is used to create a line break in HTML?
a) <br>
b) <lb>
c) <break>
d) <line>
Answer: a) <br>
6. What is the correct HTML element for inserting a line break?
a) <break>
b) <br>
c) <lb>
d) <line>
Answer: b) <br>
7. The <title> element is used for?
a) Displaying a heading on the page
b) Setting the page title in the browser tab
c) Adding subtitles to a page
d) Creating a tooltip
Answer: b) Setting the page title in the browser tab
8. How do you add a background color in HTML?
a) <body color="blue">
b) <body style="background-color:blue;">
c) <background>blue</background>
d) <body bg="blue">
Answer: b) <body style="background-color:blue;">
9. Which HTML element defines the main content of a document?
a) <section>
b) <body>
c) <main>
d) <article>
Answer: c) <main>
10. Which HTML tag is used to define a table row?
a) <tr>
b) <td>
c) <th>
d) <table>
Answer: a) <tr>
11. Which input type is used for passwords?
a) <input type="text">
b) <input type="password">
c) <input type="secure">
d) <input type="hidden">
Answer: b) <input type="password">
12. What is the correct HTML for making a text input field required?
a) <input type="text" required>
b) <input type="text" validate>
c) <input type="text" mandatory>
d) <input type="text" mustfill>
Answer: a) <input type="text" required>
13. Which HTML tag is used to define a drop-down list?
a) <dropdown>
b) <select>
c) <option>
d) <list>
Answer: b) <select>
14. How do you create a checkbox in HTML?
a) <input type="checkbox">
b) <input type="check">
c) <checkbox>
d) <input check>
Answer: a) <input type="checkbox">
15. Which attribute specifies that an input field must be filled out?
a) placeholder
b) validate
c) required
d) mandatory
Answer: c) required
16. What is the new HTML5 element for graphics?
a) <graphic>
b) <canvas>
c) <draw>
d) <svg>
Answer: b) <canvas>
17. Which HTML5 element is used to play audio files?
a) <sound>
b) <mp3>
c) <audio>
d) <media>
Answer: c) <audio>
18. What is the correct way to embed a video in HTML5?
a) <video src="movie.mp4" controls>
b) <media src="movie.mp4" controls>
c) <mp4 src="movie.mp4" controls>
d) <movie src="movie.mp4" controls>
Answer: a) <video src="movie.mp4" controls>
19. The <header> element is used to?
a) Define a header section of a webpage
b) Create a heading
c) Store meta information
d) Create a table header
Answer: a) Define a header section of a webpage
20. What does the <footer> tag define?
a) End of a document
b) A bottom navigation bar
c) Footer section of a webpage
d) A paragraph
Answer: c) Footer section of a webpage
21. Which HTML tag is used to define a navigation menu?
a) <menu>
b) <nav>
c) <navigation>
d) <menubar>
Answer: b) <nav>
22. Which tag is used to group elements in a block in HTML?
a) <div>
b) <span>
c) <section>
d) <block>
Answer: a) <div>
23. The <article> tag is used to?
a) Define an article section
b) Create a paragraph
c) Add a side content
d) Display a quote
Answer: a) Define an article section
24. What is the purpose of the <aside> element?
a) To create a sidebar
b) To add an advertisement
c) To define an article
d) To add a quote
Answer: a) To create a sidebar
25. The <mark> tag in HTML is used to?
a) Highlight text
b) Underline text
c) Make text bold
d) Change text color
Answer: a) Highlight text
26. Which input type allows users to select a file?
a) <input type="text">
b) <input type="upload">
c) <input type="file">
d) <input type="selectfile">
Answer: c) <input type="file">
27. Which attribute is used in HTML5 to show an input hint?
a) hint
b) tooltip
c) placeholder
d) title
Answer: c) placeholder
28. The <fieldset> element is used to?
a) Define a set of checkboxes
b) Group related form elements
c) Create a table in a form
d) Validate form input
Answer: b) Group related form elements
29. What does the <legend> tag do in HTML forms?
a) Provides a title for a fieldset
b) Defines a footer
c) Displays a tooltip
d) Creates a label for a form field
Answer: a) Provides a title for a fieldset
30. Which attribute is used to make a form input read-only?
a) disabled
b) readonly
c) static
d) locked
Answer: b) readonly
31. Which tag is used to display an image in HTML?
a) <img>
b) <image>
c) <picture>
d) <src>
Answer: a) <img>
32. What attribute specifies the path of an image file in <img> tag?
a) src
b) href
c) path
d) location
Answer: a) src
33. The <source> tag is used within which elements?
a) <audio> and <video>
b) <img> and <video>
c) <picture> and <table>
d) <table> and <form>
Answer: a) <audio> and <video>
34. Which HTML5 element provides a container for multiple image sources?
a) <media>
b) <picture>
c) <imgset>
d) <figure>
Answer: b) <picture>
35. The <figcaption> tag is used for?
a) Captioning a table
b) Providing a description for an image in <figure>
c) Adding a title to a video
d) Creating an image caption inside <img>
Answer: b) Providing a description for an image in <figure>
36. Which attribute specifies where to open a linked document in <a> tag?
a) target
b) href
c) destination
d) location
Answer: a) target
37. What value of the target attribute opens a link in a new tab?
a) _self
b) _new
c) _blank
d) _tab
Answer: c) _blank
38. How do you create an email link in HTML?
a) <a href="email:[email protected]">
b) <a href="mailto:[email protected]">
c) <mail>[email protected]</mail>
d) <a email="[email protected]">
Answer: b) <a href="mailto:[email protected]">
39. Which tag is used to define a bookmarkable section in a webpage?
a) <anchor>
b) <id>
c) <section>
d) <a name="bookmark">
Answer: d) <a name="bookmark">
40. What does the rel attribute in <a> tag define?
a) Relationship between the current and linked document
b) Target location of the link
c) Font style of the link
d) The text color of the link
Answer: a) Relationship between the current and linked document
41. What is the default alignment of text in an HTML paragraph?
a) Left
b) Center
c) Right
d) Justified
Answer: a) Left
42. Which attribute is used to specify an alternate text for an image?
a) alt
b) title
c) desc
d) name
Answer: a) alt
43. What is the correct HTML5 declaration?
a) <!DOCTYPE html5>
b) <!DOCTYPE HTML>
c) <doctype html>
d) <html version="5">
Answer: b) <!DOCTYPE HTML>
44. Which tag is used to define metadata about an HTML document?
a) <meta>
b) <head>
c) <info>
d) <description>
Answer: a) <meta>
45. The <time> tag is used for?
a) Defining a clock display
b) Displaying a time format
c) Marking up a time-related event
d) Defining a time zone
Answer: c) Marking up a time-related event
46. What does the <abbr> tag define?
a) An acronym or abbreviation
b) A shortcut
c) A small text
d) A superscript text
Answer: a) An acronym or abbreviation
47. What does the <kbd> tag represent?
a) Keyboard input
b) Bold text
c) Italic text
d) A code snippet
Answer: a) Keyboard input
48. The <progress> tag is used to?
a) Show an ongoing process
b) Display a loading animation
c) Create a bar chart
d) Highlight text
Answer: a) Show an ongoing process
49. What does the <wbr> tag do?
a) Defines a line break opportunity
b) Creates a word break
c) Displays a space
d) Inserts a horizontal line
Answer: a) Defines a line break opportunity
50. Which tag defines a client-side script in HTML?
a) <script>
b) <style>
c) <js>
d) <client>
Answer: a) <script>
51. The tag used to create a hypertext relationship between the current document and
another URL is:
A. <ISINDEX>
B. <A>
C. <LINK>
D. None of these
52. How can you make an email link?
A. <mailhref="[email protected]">
B. <a href="mailto:[email protected]">
C. <a href="[email protected]">
D. Both (B) and (C)
53. To create a combo box (drop-down box), which tag will you use?
A. <select>
B. <list>
C. <input type="dropdown">
D. All of the above
54. What is the correct HTML tag for inserting a line break?
A. <br>
B. <break>
C. <lb>
D. <newline>
55. Which tag is used to create a hyperlink?
A. <link>
B. <a>
C. <href>
D. <url>
56. Which of the following is the correct way to comment in HTML?
A. /* This is a comment */
B. // This is a comment
C. <!-- This is a comment -->
D. # This is a comment
57. The attribute used to open a link in a new tab is:
A. target="_self"
B. target="_new"
C. target="_blank"
D. target="new"
58. HTML is considered as:
A. A programming language
B. A markup language
C. A scripting language
D. None of the above
59. Which of the following HTML elements is used to define important text?
A. <b>
B. <strong>
C. <i>
D. <important>
60. Which tag is used for inserting an image in HTML?
A. <img>
B. <image>
C. <src>
D. <picture>
61. Which property is used to change the background color in CSS?
A. bgcolor
B. background-color
C. color-background
D. bg-color
62. How do you apply an external CSS file to an HTML document?
A. <style src="styles.css">
B. <css href="styles.css">
C. <link rel="stylesheet" href="styles.css">
D. <stylesheet>styles.css</stylesheet>
63. Which CSS property is used to change text color?
A. text-color
B. font-color
C. color
D. text-style
64. What does CSS stand for?
A. Colorful Style Sheets
B. Creative Style Sheets
C. Cascading Style Sheets
D. Computer Style Sheets
65. The default positioning of an HTML element is:
A. absolute
B. relative
C. static
D. fixed
66. Which tag is used to create a form in HTML?
A. <form>
B. <input>
C. <textbox>
D. <div>
67. The <input> element in an HTML form is used to:
A. Display an image
B. Capture user input
C. Create a hyperlink
D. Display a paragraph
68. The method attribute in <form> can have the following values:
A. GET
B. POST
C. Both A & B
D. None of these
69. The default value of the method attribute in a form is:
A. GET
B. POST
C. SUBMIT
D. REQUEST
70. The <textarea> element is used to:
A. Display images
B. Allow multiline text input
C. Create a hyperlink
D. Insert a table
71. What does the <!DOCTYPE html> declaration do?
72. A. Defines the HTML version
B. Declares a CSS file
C. Specifies JavaScript usage
D. Defines the body of the document
Answer: A. Defines the HTML version

73. Which tag is used to define the main HTML document?


A. <body>
B. <html>
C. <head>
D. <title>
Answer: B. <html>

74. Where do you place the metadata for a web page?


A. Inside <body>
B. Inside <footer>
C. Inside <head>
D. Inside <main>
Answer: C. Inside <head>

75. Which tag represents the largest heading in HTML?


A. <h6>
B. <h3>
C. <h1>
D. <p>
Answer: C. <h1>

76. Which tag is used for bold text?


A. <i>
B. <strong>
C. <u>
D. <em>
Answer: B. <strong>
77. Which tag creates italicized text?
A. <i>
B. <em>
C. Both A & B
D. <strong>
Answer: C. Both A & B
78. Which tag is used for an unordered list?
A. <ul>
B. <ol>
C. <li>
D. <dl>
Answer: A. <ul>

79. What does the <ol> tag represent?


A. Ordered List
B. Outline List
C. Object List
D. None of the above
Answer: A. Ordered List

80. Which tag is used to define list items in both ordered and unordered lists?

A. <list>
B. <li>
C. <ol>
D. <ul>
Answer: B. <li>

81. Which tag is used to create a hyperlink?

A. <link>
B. <a>
C. <href>
D. <nav>
Answer: B. <a>

82. What attribute is used to define a hyperlink destination?

A. src
B. href
C. link
D. target
Answer: B. href

83. What does target="_blank" do in an <a> tag?


A. Opens the link in the same window
B. Opens the link in a new tab
C. Displays an error
D. Removes the link
Answer: B. Opens the link in a new tab

84. Which tag is used to create a table?

A. <tr>
B. <td>
C. <table>
D. <th>
Answer: C. <table>

85. Which tag is used to define a table row?

A. <tr>
B. <td>
C. <table>
D. <th>
Answer: A. <tr>

86. Which tag is used to define table data (cells)?

A. <td>
B. <tr>
C. <th>
D. <table>
Answer: A. <td>

87. Which tag is used to create an input field in a form?


A. <form>
B. <input>
C. <textarea>
D. <button>
Answer: B. <input>

88. What is the correct HTML tag for a checkbox?

A. <checkbox>
B. <input type="checkbox">
C. <input checkbox>
D. <check>
Answer: B. <input type="checkbox">

89. Which input type is used for passwords?

A. <input type="password">
B. <password>
C. <input password>
D. <input type="text">
Answer: A. <input type="password">

90. Which tag is used to embed an image?

A. <img>
B. <picture>
C. <src>
D. <image>
Answer: A. <img>

91. What attribute must be used to specify an image URL?


A. href
B. src
C. url
D. link
Answer: B. src

92. Which tag is used for embedding a video?

A. <movie>
B. <video>
C. <media>
D. <clip>
Answer: B. <video>

93. Which tag is used to define a navigation section?

A. <navigate>
B. <nav>
C. <section>
D. <menu>
Answer: B. <nav>

94. Which tag represents the main content of a document?

A. <main>
B. <body>
C. <div>
D. <header>
Answer: A. <main>

95. What does <section> tag define?


A. A navigation area
B. A separate content block
C. An unordered list
D. A hyperlink
Answer: B. A separate content block

96. Which tag is used to define metadata?

A. <data>
B. <meta>
C. <info>
D. <details>
Answer: B. <meta>

97. Which tag is used for line breaks?

A. <br>
B. <lb>
C. <break>
D. <newline>
Answer: A. <br>

98. Which tag defines a horizontal rule (line)?

A. <line>
B. <hr>
C. <br>
D. <separator>
Answer: B. <hr>

99. Which tag is used for comments in HTML?


A. <!-- comment -->
B. // comment
C. /* comment */
D. # comment
Answer: A. <!-- comment -->

100. What does <aside> represent?

A. Sidebar content
B. A main heading
C. Footer section
D. Image description
Answer: A. Sidebar content

You might also like