HTML MCQ's (Multiple Choice Questions)

1) HTML stands for -

  • HighText Machine Language
  • HyperText and links Markup Language
  • HyperText Markup Language
  • None of these

HTML, short for HyperText Markup Language, serves as the foundation for developing web pages and web applications.

The term HyperText can be understood as "Text embedded within Text." When a text contains a hyperlink, it is considered hypertext. A markup language is a type of computer language utilized for implementing styling and formatting standards on a textual document.

2) The correct sequence of HTML tags for starting a webpage is -

  • Head, Title, HTML, body
  • HTML, Body, Title, Head
  • HTML, Head, Title, Body
  • HTML, Head, Title, Body

The appropriate order of HTML elements to initiate a webpage includes the html tag, followed by head, title, and body tags in sequence.

3) Which of the following element is responsible for making the text bold in HTML?

  • <pre>
  • <br>

The bold tag (<b>) in HTML is utilized to present text in a bold style.

4) Which of the following tag is used for inserting the largest heading in HTML?

  • <h3>
  • <h1>
  • <h5>
  • <h6>

The <h1> tag is utilized for incorporating the primary heading or the top-level heading.

5) Which of the following tag is used to insert a line-break in HTML?

  • <br>
  • <pre>

The <br> tag within an HTML file serves the purpose of inserting a line break within text content. Introducing the <br> tag in HTML functions equivalently to hitting the "enter" key on a typical word processing application.

6) How to create an unordered list (a list with the list items in bullets) in HTML?

  • <ul>
  • <ol>
  • <li>

In HTML, the <ul> tag serves the purpose of presenting list items in a bulleted manner. There are four variations of unordered lists that can be utilized: disc, circle, square, and none.

7) What symbol is employed to signify the conclusion of a tag in HTML?

The forward-slash symbol, denoted as (/), serves the purpose of signaling the conclusion of a tag in HTML.

8) How to create a hyperlink in HTML?

  • <a href = "www.logic-practice.com"> logic-practice.com </a>
  • <a url = "www.logic-practice.com" logic-practice.com /a>
  • <a link = "www.logic-practice.com"> logic-practice.com </a>
  • <a> www.logic-practice.com <logic-practice.com /a>

Solution: (a) Visit the website logic-practice.com for more information.

In HTML, the creation of a link is achieved by utilizing the anchor tag alongside the href attribute.

9) How to create an ordered list (a list with the list items in numbers) in HTML?

  • <ul>
  • <ol>
  • <li>

In HTML, the <ol> tag serves the purpose of presenting list items in a format that includes numbering. Various styles of numbering can be applied, such as numeric digits, uppercase letters, lowercase letters, and more.

10) Which of the following element is responsible for making the text italic in HTML?

  • <italic>
  • <it>
  • <pre>

The HTML tag <i> (italic tag) is utilized to present text in an italicized format.

11) How to insert an image in HTML?

The combination of the img tag and the src attribute is commonly utilized to showcase an image within a webpage.

12) How to add a background color in HTML?

  • <marquee bg color: "red">
  • <marquee bg-color = "red">
  • <marquee bgcolor = "red">
  • <marquee color = "red">

The bgcolor attribute is utilized to define the background color of an HTML element.

13) <input> is -

  • a format tag.
  • an empty tag.
  • All of the above
  • None of the above

The <input> tag is utilized in HTML to denote a form input element within an HTML file.

14) Which of the following tag is used to make the underlined text?

  • <ul>
  • <pre>

The <u> tag in HTML is employed to showcase text with underlining. It appears as a continuous line underneath the text, and its appearance can be customized through CSS attributes.

15) How to create a checkbox in HTML?

  • <input type = "checkbox">
  • <input type = "button">
  • <checkbox>
  • <input type = "check">

To generate a checkbox in HTML, the <input> tag should be utilized, and the type attribute should be assigned the value "checkbox".

16) Which of the following tag is used to define options in a drop-down selection list?

  • <select>
  • <list>
  • <dropdown>
  • <option>

Explanation: The <option> tag in HTML is used to define options in a dropdown list within <select> or <datalist> element. A dropdown list must have at least one <option> element.

17) HTML tags are enclosed in-

  • # and #
  • { and }
  • ! and ?
  • < and >

When working with HTML, it is essential to ensure that all tags are enclosed within angular < > brackets.

18) Which of the following tag is used to add rows in the table?

  • <td> and </td>
  • <th> and </th>
  • <tr> and </tr>
  • None of the above

Explanation: The <tr> tag in HTML is used to define the rows in the table. It can consist one or more <th> head cells and <td> data cells to define a single row of HTML table.

19) The <hr> tag in HTML is used for -

  • new line
  • vertical ruler
  • new paragraph
  • horizontal ruler

The <hr> tag in HTML is utilized for indicating a thematic break at the paragraph level. This tag, also known as a horizontal rule, creates a line horizontally.

20) Which of the following attribute is used to provide a unique name to an element?

  • class
  • type
  • None of the above

The id attribute in HTML is utilized to assign a distinct identifier to an element within the document. This identifier is then accessible for JavaScript and CSS to execute specific functions.

21) Which of the following HTML tag is used to display the text with scrolling effect?

  • <marquee>
  • <scroll>
  • <div>
  • None of the above

The <marquee> tag is an unconventional HTML element designed for scrolling text or images in either a horizontal or vertical direction. Essentially, it facilitates automatic scrolling of content in various directions such as up, down, left, or right.

22) Which of the following HTML tag is the special formatting tag?

  • <pre>
  • None of the above

Explanation: The HTML <pre> tag is used to specify pre-formatted texts. Texts within <pre>…</pre> tag is displayed in a fixed-width font. Usually, it is displayed in courier font. It maintains both line break space.

23) Which of the following is the correct way to send mail in HTML?

  • <a href = "mailto: xy@y">
  • <a href = "xy@y">
  • <mail xy@y</mail>
  • None of the above

The <a> tag along with the href attribute can be utilized to send an email to a recipient.

24) Which of the following is the container for <tr>, <th>, and <td> ?

  • <data>
  • <table>
  • <group>
  • All of the above

Explanation: The <table> tag in HTML, is generally used to display data in tabular format. We can create a table to display the data in the tabular form using the <table> element, with the help of <tr>, <th>, and <td> elements.

25) How to insert a background image in HTML?

  • <body background = "img.png">
  • <img background = "img.png">
  • <bg-image = "img.png">
  • None of the above

To set a background image for the entire document, it is necessary to define the background attribute within the <body> of the HTML document.

26) What are the types of unordered or bulleted list in HTML?

  • disc, square, triangle
  • polygon, triangle, circle
  • disc, circle, square
  • All of the above

The unordered list in HTML is utilized to exhibit elements in a bulleted style. There are primarily three variations of an unordered list: disc, circle, and square.

27) Which of the following is the correct way to create a list using the lowercase letters?

  • <ol alpha = "a" >
  • <ol type = "a">
  • <ol letter = "a">
  • None of the above

The type attribute is employed in conjunction with the <ol> tag to indicate the kind of list items.

28) Which of the following is the correct way to start an ordered list with the count of numeric value 4?

  • <ol type = "1" initial = "4">
  • <ol type = "1" begin = "4">
  • <ol type = "1" num = "4">
  • <ol type = "1" start = "4">

The start attribute is utilized in conjunction with the <ol> tag to indicate the starting point for the list items.

29) Which of the following HTML attribute is used to define inline styles?

  • style
  • type
  • class
  • None of the above

In HTML, the style attribute is utilized to modify the appearance of HTML elements that already exist. This attribute is compatible with all HTML tags. To implement styling on an HTML tag, it is essential to possess a foundational understanding of CSS properties.

30) Which of the following is the paragraph tag in HTML?

  • <pre>
  • None of the above

The HTML tag <p> is utilized to specify a paragraph within a webpage. It signifies the commencement of a new paragraph in HTML when the tag <p> is encountered.

31) An HTML program is saved by using the ____ extension.

  • .html
  • .hml
  • None of the above

When saving HTML programs, it is common to use either the .html or .htm extension. Both extensions serve the purpose of indicating that the file contains HTML content. This distinction is important when files are shared over a network, as the presence of the HTML extension informs users about the type of content within the file.

32) A program in HTML can be rendered and read by -

  • Web browser
  • Server
  • Interpreter
  • None of the above

HTML code is designed to be interpreted and displayed by a web browser, which has the capability to handle multiple web pages.

33) The tags in HTML are -

  • case-sensitive
  • in upper case
  • not case sensitive
  • in lowercase

In HTML, tags can be written in either uppercase or lowercase since HTML is not case-sensitive. However, for better readability and consistency, it is advisable to use lowercase letters when writing tags. This practice helps maintain clarity and uniformity in code structure.

34) Which of the following is the root tag of the HTML document?

  • <body>
  • <head>
  • <title>
  • <html>

Explanation: The <html> tag represents the root of an HTML document, hence also called as the root element. It is a container of all elements (except !Doctype) such as <head>, <body> and each element which appears in the HTML document.

35) In HTML5, which of the following tag is used to initialize the document type?

  • <Doctype HTML>
  • <\Doctype html>
  • <Doctype>
  • <!DOCTYPE html>

The purpose of the <!DOCTYPE html> tag is to indicate to the browser the HTML version being utilized in the document. This tag is commonly referred to as the document type declaration (DTD).

36) Which of the following tag is used to create a combo box (or drop-down box)?

  • <list>
  • <select>
  • <input type = "dropdown">
  • <ul>

Explanation: HTML <select> tag is used to create a drop down list with multiple options. The <option> element is nested within the <select> tag to define options in a list.

37) Which of the following are the attributes of the

  • method
  • action
  • Both (a) & (b)
  • None of the above

The <form> tag is utilized to generate an HTML form for gathering user input. Within this tag, both method and action are defined as attributes. The action attribute determines the destination for the form data upon submission, while the method attribute specifies the HTTP method (GET or POST) for transmitting the form data.

38) Which is the correct way to comment out something in HTML?

  • Using ## and #
  • Using <!-- and -->
  • Using </-- and -/->
  • Using <!-- and -!>

In HTML, to create a comment, the content should be enclosed within <!— and --> tags. Comments are annotations in the form of text or code that offer insights about the code but are not displayed to users. They enhance the clarity of the codebase and aid in comprehending the code structure.

39) Which HTML tag is used to display the power in expression, i.e., (x 2 - y 2 )?

  • <sup>
  • <sub>
  • None of the above

The HTML <sup> tag is known as a superscript tag in HTML, and it is utilized to specify text that should be displayed as superscript. Content enclosed within the <sup> tag will be raised above the baseline and displayed in a smaller font size compared to the adjacent text.

40) Which of the following is the correct way to change the font face in HTML?

  • <font name = "Calibri"> ……… </font>
  • <font face = "Calibri"> ……… </font>
  • <font = "Calibri"> ……… </font>
  • None of the above

The HTML <font> element is utilized to specify the font style of the text it encloses. Within an HTML document, the face attribute of the <font> tag is employed to determine the typeface of the text.

Input Required

This code uses input(). Please provide values below: