HTML Multiple Choice Questions
Q1. What does HTML stand for?
- Hypertext Markup Language
- Home Tool Markup Language
- Hyperlinks and Text Markup Language
- None of the above
Answer 1: a. Hypertext Markup Language
Explanation: HTML stands for Hypertext Markup Language. It is a code that is typically used to give structure to a web page and the content in it.
Q2. Which amongst the following is the correct HTML tag for the largest heading?
- <head>
- <h1>
- <heading>
- None of the above
Answer 2: b. <h1>
Explanation: <h1> is a HTML element used for displaying the largest heading on a web page.
Q3. Which amongst the following is responsible for inserting a line break in HTML?
- <tr>
- <br>
- <lb>
- <break>
Answer 3: b. <br>
Explanation: The HTML element <br> is used for inserting a line break. It is typically used while writing addresses and personal information, where the lines need to be divided.
Q4. What type of language is HTML?
- Scripting language
- Programming language
- Markup language
- None of the above
Answer 4: c. Markup language
Explanation: HTML is a Markup language because it sums up the data inside the HTML tags.
Q5. What is the HTML code for adding a background color?
- <body style= “background-color:red;”>
- <background>red</background>
- <bg>red</bg>
- None of the above
Answer 5: a. <body style= “background-color:red;”>
Explanation: To add background color in HTML, “style” attribute is used. The “style” attribute states the inline style for an element. The “style” attribute is used with “body” tag in HTML where the web designer can add the background color.
Q6. Which amongst the following tags is used to specify important texts in HTML?
- <b>
- <important>
- <imptext>
- <strong>
Answer 6: d. <strong>
Explanation: <strong> tag is used for defining the important texts in HTML. The <strong> tag highlights the content semantically and denote the text or any other content inside it important. This tag displays the content inside it in bold manner.
Q7. Which amongst the following tags is used to make the text bold in HTML?
- <b>
- <bold>
- <bd>
- <a>
Answer 7: a. <b>
Explanation: <b> tag is used to make the text bold in HTML. It does not give any semantic meaning to the text.
Q8. What is the main difference between <strong> tag and <b> tag in HTML?
- <strong> tag is used to make text bold only, and <b> tag adds extra semantic importance to the content
- <strong> tag adds extra semantic importance to the content, and <b> tag is used to make text bold only
- There is no difference between <strong> tag and <b> tag
- None of the above
Answer 8: <strong> tag adds extra semantic importance to the content, and <b> tag is used to make text bold only
Explanation: The only difference between <strong> tag and <b> tag is that the <strong> tag adds semantic importance to the content inside it; on the contrary, the <b> tag does not give any extra importance to the text apart from making it bold.
Q9. Which amongst the following tags is used to mark the beginning of a paragraph in HTML?
- <a>
- <br>
- <hr>
- <p>
Answer 9: <p>
Explanation: <p> tag is used for defining a paragraph of in HTML.
Q10. Which tag is the first tag in a HTML document?
- <head>
- <body>
- <title>
- <html>
Answer 10: d. <html>
Explanation: <html> is the first tag in a HTML document. It represents the root of an HTML document. It contains all the other tags of HTML.
Q11. Which of the following is the attribute of <form> tag in HTML?
- Action
- Method
- Both (a) and (b)
- None of the above
Answer 11: c. Both (a) and (b).
Explanation: The <form> tag’s Attribute in HTML is used to define that the element can contain one or more forms.
Q12. Which amongst the following are correct HTML code for creating a hyperlink?
- <a>https://www.tutorialandexample.com/</a>
- <a url=”https://www.tutorialandexample.com/“>Tutorial and Example</a>
- <a”https://www.tutorialandexample.com/“>Tutorial and Example</a>
- <a href=“https://www.tutorialandexample.com/“> Tutorial and Example</a>
Answer 12: d. <a href=“https://www.tutorialandexample.com/“> Tutorial and Example</a>
Explanation: <a> tag is used to describe the hyperlink, which is used to link different pages in HTML. “href” is the attribute of <a> element, which is used to specify the link’s target.
Q13. What is the correct HTML code for opening a link in a new tab or new browser window?
- <a href=”url” target=”new”>
- <a href=”url” target=”_blank”>
- Both (a) and (b)
- None of the above
Answer 13: b. <a href=”url” target=”_blank”>
Explanation: target attribute is used to inform the browser to open the link in the new tab. _blank is assigned to target attribute which informs the browser to open link in the new tab or window, based on the default settings of browser.
Q14. Which amongst the following is the correct HTML code for creating a bulleted list?
- <list>
- <blist>
- <ol>
- <ul>
Answer 14: d. <ul>
Explanation: The <ul> tag is used to specify the unordered list or the bulleted list in HTML.
Q15. Which amongst the following is the correct HTML code for creating an ordered list?
- <ol>
- <olist>
- <ul>
- None of the above
Answer 15: a. <ol>
Explanation: The <ol> tag is used to specify the ordered list in HTML i.e., in numbered formation. This ordered list can be numeric or alphabetic.
Q16. Which among the following tag is used for making text italic in HTML?
- <italic>
- <i>
- <I>
- None of the above
Answer 16: b. <i>
Explanation: The <i> tag is used to show the text in italic format.
Q17. Which among the following is the correct HTML code for inserting an image?
- <image alt=”SampleImage”>image.gif</image>
- <img href=”image.gif” alt= “SampleImage”>
- <image src=”image.gif” alt= “SampleImage”>
- <img src=”image.gif” alt= “SampleImage”>
Answer 17: d. <img src=”image.gif” alt= “SampleImage”>
Explanation: The <img> tag is used to insert an image in a HTML page. The <img> tag has two major attributes: src (specifies the path to the image) and alt (specifies the alternate name for the image in case the image is not displayed).
Q18. Which amongst the following is the correct doctype for HTML?
- <Doctype HTML>
- <\Doctype html>
- <Doctype>
- <!DOCTYPE html>
Answer 18: d. <!DOCTYPE html>
Explanation: <!DOCTYPE html> is not a tag or element; it is an instruction to the browser about the type of document. It is used to tell the browser the version of HTML used in the document.
Q19. What is an <input> tag?
- a format tag
- an empty tag
- All of the above
- None of the above
Answer 19: b. an empty tag
Explanation: The <input> tag in HTML is used to describe an input field in which the user can enter data. The <input> tag is the most important tag in the form element.
Q20. In HTML, what is the role of the <aside> element?
- Content aside from the page content
- The ASCII character-set; to send information between computers on the Internet
- A navigation list to be shown at the left side of the page
- None of the above
Answer 20: a. Content aside from the page content
Explanation: The <aside> tag is used to display some of the content in the HTML document aside from the content it is positioned on. The <aside> tag is usually seen as a sidebar in a HTML document.
Q21. Which amongst the following are the attributes of <input> tag in HTML?
- Type
- Name
- Max
- All of the above
Answer 21: d. All of the above
Explanation: The <input> tag has various attributes. The “type” attribute is used to define the type of input, i.e., text, password and so on. The “name” attribute is used to define the name of the element, and the “max” attribute is used to define the maximum number of characters.
Q22. What are the empty elements in HTML?
- There is no such element as an empty element.
- Empty elements are elements with no data.
- Empty elements are elements that are not valid in HTML.
- None of the above
Answer 22: b. Empty elements are elements with no data.
Explanation: The elements that don’t have any content in themselves and do not have an end tag in HTML are called Empty Elements.
Q23. Which amongst the following is the subset of HTML?
- SGML
- SGMT
- SGMD
- None of the above
Answer 23: a. SGML
Explanation: SGML is an acronym for Standard Generalized Markup Language. It is a language that is used for defining Markup Languages. HTML is one of its applications.
Q24. Which amongst the following tags is used to make the text underlined?
- <ud>
- <ol>
- <ul>
- <u>
Answer 24: d. <u>
Explanation: The <u> tag is used to make the text underlined in HTML. It is generally used to highlight a word or sentence in a HTML document.
Q25. Tags is HTML are enclosed in:
- < and >
- “ and “
- ? and ?
- { and }
Answer 25: a. < and >
Explanation: All the tags in HTML are enclosed in angle brackets < and >.
Q26. Why is <hr> tag used in HTML?
- Vertical ruler
- Horizontal ruler
- New line
- None of the above
Answer 26: b. Horizontal ruler
Explanation: The <hr> tag in HTML is for horizontal rule. It is used to insert a horizontal rule or a thematic break in an HTML page in order to divide or separate the HTML document sections. The <hr> tag is an empty tag or singleton tag, which means it does not require an end tag.
Q27. What is meant by “Character Encoding”?
- A method that represents characters in numbers
- A method that represents numbers in characters
- A method that converts bytes into characters
- None of the above
Answer 27: c. A method that converts bytes into characters
Explanation: “Character Encoding” in HTML is used to convert bytes into characters. In order to display an HTML document properly, proper Character Encoding must be chosen.
Q28. What is meant by “Singleton Tags” in HTML?
- Elements that do not have a closing tag
- Elements that can only take single values
- Elements that must appear as pairs
- None of the above
Answer 28: a. Elements that do not have a closing tag.
Explanation: “Singleton Tags” are the tags that do not need a closing tag. They are also called “void tags.” They are only used with “attribute only” tags in HTML. Some examples of “Singleton Tags” are <br>, <hr>, <img>, <command>, and so on.
Q29. What amongst the following is not a Singleton Tag?
- <img>
- <br>
- <hr>
- <strong>
Answer 29: d. <strong>
Explanation: The <strong> tag is not a Singleton Tag in HTML as it requires a closing tag.
Q30. What is the main difference between Elements and Tags in HTML?
- Tags are just opening and closing entities; element includes an opening, closing and the content.
- Tags include opening, closing, and the content; elements are just opening and closing entities.
- There is no difference between elements and tags.
- None of the above
Answer 30: a. Tags are just opening and closing entities; element includes an opening, closing and the content.
Explanation: The elements in HTML consist of the beginning tag, attributes of the tags, end tag and everything that comes in between. However, the tags in HTML are just the beginning tag and end tag.
Q31. What is meant by an Anchor tag in HTML?
- It is used to open a URL in a new tab.
- It is used to link two sections or two web pages.
- There is no such thing as an Anchor tag in HTML.
- None of the above
Answer 31: b. It is used to link two sections or two web pages.
Explanation: The anchor tag in HTML creates a link between two sections or two web pages. This tag contains three parts that are href attribute, name attribute, and target attribute.
Q32. Which amongst the following is the correct method of inserting a comment in HTML?
- <!–Sample–>
- <–Sample–>
- <!–Sample–!>
- None of the above
Answer 32: a. <!–Sample–>
Explanation: In HTML, the comment tag begins with <!– ….. –> and in between these symbols are the comment inserted.
Q33. Which element is used to put a scrolling text in a web page?
- <marquee>
- <scroll>
- <scrolltext>
- None of the above
Answer 33: a.<marquee>
Explanation: The <marquee> tag in HTML is used to display a scrolling piece of tag either horizontally or vertically across the screen in a HTML document.
Q34. Which amongst the following is the correct HTML code for putting a background image in a HTML document?
- <body background= ”image.gif”>
- <image background= “image.gif”>
- <background>”image.gif”</background>
- None of the above
Answer 34: a. <body background= ”image.gif”>
Explanation: In HTML, the background attribute is inserted in <body> tag. It is followed by the place where the image is placed in the system.
Q35. Which amongst the following browser supports HTML5?
- Google Chrome
- Apple Safari
- Mozilla Firefox
- All of the above
Answer 35: d. All of the above
Explanation: HTML5 is supported by Google Chrome, Apple Safari, Mozilla Firefox, and Opera.
Q36. Which amongst the following is a Block level element in HTML?
- <div>
- <p>
- <img>
- All of the above
Answer 36: d. All of the above
Explanation: In HTML, block-level elements are the elements that start in a new line, such as a paragraph. It makes use of the complete width of the page or container in an HTML document.
Q37. Which amongst the following is used to list elements in HTML?
- <ol>
- <ul>
- <dl>
- All of the above
Answer 37: d. All of the above
Explanation: The <ol> tag in HTML is used to create an ordered list, the <ul> tag is used to create an unordered list or a bulleted list, and the <dl> tag is used to create a description list. All of these tags are list elements in HTML.
Q38. What is meant by XHTML?
- Extensible hyper text markup language
- Extensible markup language
- Extensive markup language
- Extensive hyper text markup language
Answer 38: a. Extensible hyper text markup language
Explanation: XHTML is a part of XML markup languages. XHTML is HTML defined as an XML application. All the commonly used browsers support it.
Q39. Which amongst the following options are the elements of <table> in HTML?
- <table><trow><td>
- <table><tr><tt>
- <table><body><td>
- <table><tr><td>
Answer 39: d. <table><tr><td>
Explanation: In HTML, the table are used to arrange data into rows and columns. The <tr> tag is used to describe the table row and the <td> tag is used to describe the table data or cell.
Q40. Which amongst the following are the correct code for making a checkbox in HTML?
- <input type = “check”>
- <checkbox>”content”</checkbox>
- <check>
- <input type = “checkbox”>
Answer 40: d. <input type = “checkbox”>
Explanation: The <input type=”checkbox”> describes a checkbox in HTML.
Q41. Which amongst the following is the correct HTML code for creating a dropdown list?
- <input type= “dropdown”>
- <input type= “list”>
- <input type= “drop”>
- <select>
Answer 41: d. <select>
Explanation: The <select> element is responsible for creating used to a drop-down list in HTML. The <select> element is usually used in a form when the user input has to be collected.
Q42. What is <iframe> tag used for?
- To display a web page within a web page.
- To specify an inline frame.
- Both (a) and (b)
- None of the above
Answer 42: c. Both (a) and (b)
Explanation: The <iframe> tag is used to embed another document within the current HTML document.
Q43. Which amongst the following tag is used to specify the title of a web page in HTML?
- <head>
- <title>
- <t>
- None of the above
Answer 43: b. <title>
Explanation: The <title> tag in HTML is used to specify the title of the HTML document. This tag is a required tag. It defines the title in the browser toolbar and displays the page’s title in Search- engine results.
Q44. Which tag is used to describe the footer of a document or a section in an HTML document?
- <bottom>
- <section>
- <footer>
- None of the above
Answer 44: c. <footer>
Explanation: The <footer> tag is responsible for the footer of an HTML document or a section in a document. The <footer> usually contains contact information, related documents and so on. There can be several footers in a single HTML document.
Q45. For which purpose is <canvas> element used in HTML?
- To create draggable elements.
- To draw graphics
- To manipulate data in MySQL.
- To display database records.
Answer 45: b. To draw graphics
Explanation: The <canvas> tag is responsible for drawing graphics, on the fly, via scripting (usually JavaScript). The <canvas> tag is transparent and is only a container for graphics; you must use a script to draw the graphics.
Q46. Which amongst the following type is used to define a slider control?
- Range
- Search
- Slider
- None of the above
Answer 46: a. Range
Explanation: A range in the slider lets the user to control the values, i.e., maximum and minimum slider. Various types of sliders can be used in an HTML document, such as default, square, round, and image sliders.
Q47. Which amongst the following HTML element is used to describe the navigation links?
- <navigation>
- <navigate>
- <nav>
- None of the above
Answer 47: c. <nav>
Explanation: The <nav> tag is used to describe the navigation links between major blocks in a HTML document.
Q48. Which amongst the following HTML tag is used to emphasize a text?
- <i>
- <b>
- <em>
- None of the above
Answer 48: c. <em>
Explanation: To put major emphasis on some text in an HTML document, the <em> tag is used. This tag specifies to the user that this line or word is important. Generally, the text inside this tag is displayed in italic format.
Q49. Which amongst the following is the correct symbol used at the beginning of an HREF text?
- $
- &
- <
- #
Answer 49: d. #
Explanation: The HREF is prefaced with the “#” symbol in HTML.
Q50. Which amongst the following is correct HTML code for creating colorful text in a HTML document?
- <font color = “COLOR”>
- <font> “COLOR” </font>
- <color>”red”</color>
- None of the above
Answer 50: a. <font color = “COLOR”>
Explanation: In HTML, the correct code for creating a colorful text in a HTML document is to use the <font>, however, <font> tag is no more supported in the newest HTML update, i.e., HTML5. For creating colorful text, the style attribute is used like this:
<p style=”color:red”>SAMPLE PARAGRAPH</p>
Q51. Which amongst the following is the attribute that is used to add styles to an element in HTML such as color, font, and so on?
- Dir
- Style
- Color
- None of the above
Answer 51: b. Style
Explanation: Style attribute specifies an inline style for an element. The style attribute will override any style set globally, e.g., styles specified in the style tag or an external style sheet.
Q52. Which amongst the following is not a property of attribute behavior of <marquee> tag in HTML?
- Scroll
- Alternate
- Blur
- None of the above
Answer 52: b. Alternate
Explanation: Alternate is not a property of attribute behavior of <marquee> tag in HTML.
Q53. Which amongst the following code is the correct one to create an E-mail link?
- <a Href=”mailto:[email protected]“>
- <mail Href=”[email protected]”>
- <a Href=”[email protected]”>
- None of the above
Answer 53: a. <a Href=”mailto:[email protected]“>
Explanation: In HTML, the correct code for creating an E-mail link is <a Href=”mailto:[email protected]“>. To create a link that opens in the user’s email program (to let them send a new email), mailto: is used inside the href attribute in HTML.
Q54. Which amongst the following is the correct tag for defining the description data in HTML?
- <dd>
- <dl>
- <dr>
- None of the above
Answer 54: a. <dd>
Explanation: The <dd> tag is used to define the description data in HTML. In a <dd> tag, the user can put paragraphs, line breaks, images, links, lists, and so on.
Q55. Which amongst the following statements is true for HTML?
- HTML uses Fixed Tags Defined by the Language
- HTML uses User defined tags
- HTML uses a tag that was meant only for linking
- None of the above
Answer 55: a. HTML uses Fixed Tags Defined by the Language
Explanation: In HTML, the only tags that can be used is defined by the language.
Q56. Which of the following property can the intensity of color be described?
- Hue
- Saturation
- Lightness
- None of the above
Answer 56: b. Saturation
Explanation: In HTML, the intensity of a color is described with the help of saturation property.