MCQs Of Class 2 - Basic Structure of an HTML Document

Rashmi Mishra
11 minute read
0

 

MCQs Of Class 2 

Basic Structure of an HTML Document

1.What is the correct declaration for specifying the HTML5 document type?

    • a) <!DOCTYPE html5>
    • b) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5.0//EN">
    • c) <!DOCTYPE html>
    • d) <html5>

Answer: c) <!DOCTYPE html

2.Which of the following tags is used to enclose all the content of an HTML document?

    • a) <body>
    • b) <head>
    • c) <html>
    • d) <content>

Answer: c) <html>

3.What is the purpose of the <head> section in an HTML document?

    • a) To contain all the visible content of the webpage.
    • b) To store meta-information about the document, such as the title and links to CSS files.
    • c) To create the main heading of the webpage.
    • d) To define the document’s character set.

Answer: b) To store meta-information about the document, such as the title and links to CSS files.

4.Which HTML tag is used to define the title of a webpage that appears in the browser tab?

    • a) <h1>
    • b) <title>
    • c) <meta>
    • d) <head>

Answer: b) <title>

5.Where should the <meta charset="UTF-8"> tag be placed in an HTML document?

    • a) Inside the <body> tag
    • b) Inside the <html> tag, but outside <head>
    • c) Inside the <head> tag
    • d) After the closing </html> tag

Answer: c) Inside the <head> tag

6.What is the correct order of the basic structure of an HTML document?

    • a) <!DOCTYPE html>, <body>, <head>, <html>
    • b) <html>, <head>, <!DOCTYPE html>, <body>
    • c) <!DOCTYPE html>, <html>, <head>, <body>
    • d) <head>, <html>, <body>, <!DOCTYPE html>

Answer: c) <!DOCTYPE html>, <html>, <head>, <body>

7.Which tag is used to create a paragraph in an HTML document?

    • a) <p>
    • b) <para>
    • c) <paragraph>
    • d) <text>

Answer: a) <p>

8.What is the purpose of the <br> tag in an HTML document?

    • a) To create a bold text
    • b) To add a line break
    • c) To create a break between sections
    • d) To create a blank line

Answer: b) To add a line break

9.Which of the following tags is used to create a horizontal line in an HTML document?

    • a) <line>
    • b) <hr>
    • c) <br>
    • d) <hl>

Answer: b) <hr>

10.How many heading tags are available in HTML?

    • a) 3
    • b) 4
    • c) 5
    • d) 6

Answer: d) 6

11.Which tag is considered the root element of an HTML document?

    • a) <body>
    • b) <head>
    • c) <html>
    • d) <div>

Answer: c) <html>

12.In which section of an HTML document would you place CSS links or JavaScript scripts?

    • a) <body>
    • b) <head>
    • c) <title>
    • d) <html>

Answer: b) <head>

13.Which tag is used to add a line across the webpage for separation of content?

    • a) <br>
    • b) <hr>
    • c) <line>
    • d) <divider>

Answer: b) <hr>

14.If you want to add a subheading that is smaller than <h1> but larger than <h3>, which tag would you use?

    • a) <h2>
    • b) <h4>
    • c) <h5>
    • d) <h6>

Answer: a) <h2>

15.Which tag should you use to separate two paragraphs with a blank line between them?

    • a) <hr>
    • b) <br>
    • c) <p>
    • d) <div>

Answer: b) <br>

16.What is the purpose of the <!DOCTYPE html> declaration in an HTML document?

    • a) To define the title of the document
    • b) To specify the HTML version and ensure the document is rendered correctly
    • c) To insert a horizontal line
    • d) To create a paragraph

Answer: b) To specify the HTML version and ensure the document is rendered correctly

17.Which tag should be used to create the main heading on a webpage?

    • a) <h2>
    • b) <h3>
    • c) <h1>
    • d) <h4>

Answer: c) <h1>

18.How do you ensure that your HTML document uses the UTF-8 character encoding?

    • a) <meta charset="UTF-8">
    • b) <encoding="UTF-8">
    • c) <meta charset="ISO-8859-1">
    • d) <charset="UTF-8">

Answer: a) <meta charset="UTF-8">

19.Where should you place your meta tags in an HTML document?

    • a) Within the <body> tag
    • b) Within the <html> tag
    • c) Within the <head> tag
    • d) After the <body> tag

Answer: c) Within the <head> tag

20.What is the default rendering style for the <p> tag in HTML?

    • a) Bold text
    • b) Italic text
    • c) Block-level element with a space above and below
    • d) Inline element with no space around it

Answer: c) Block-level element with a space above and below

21.Which HTML tag is used to insert a line break within text?

    • a) <break>
    • b) <line>
    • c) <br>
    • d) <new-line>

Answer: c) <br>

22.What is the effect of the <hr> tag on a webpage?

    • a) It inserts a vertical line.
    • b) It inserts a horizontal line.
    • c) It creates a new paragraph.
    • d) It changes the text color.

Answer: b) It inserts a horizontal line

23.Which HTML tag is used to create a section of the webpage that can be styled with CSS?

    • a) <section>
    • b) <body>
    • c) <div>
    • d) <article>

Answer: c) <div>

24.In an HTML document, which tag is typically used for content that should appear as a separate block from other content?

    • a) <span>
    • b) <div>
    • c) <strong>
    • d) <em>

Answer: b) <div>

25.If you want to create multiple levels of headings, which tag would come immediately after <h2> in terms of hierarchy?

    • a) <h1>
    • b) <h3>
    • c) <h4>
    • d) <h5>

Answer: b) <h3>

26.What is the role of the <body> tag in an HTML document?

    • a) To contain meta-information and links to external resources
    • b) To define the document's character encoding
    • c) To enclose all the visible content that users see
    • d) To specify the document's type

Answer: c) To enclose all the visible content that users see

27.How do you add a comment in an HTML document?

    • a) <!-- This is a comment -->
    • b) /* This is a comment */
    • c) // This is a comment
    • d) ** This is a comment **

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

28.Which tag is used to group inline elements together and apply styling in HTML?

    • a) <section>
    • b) <article>
    • c) <div>
    • d) <span>

Answer: d) <span>

29.What is the purpose of the <meta> tag in the <head> section of an HTML document?

    • a) To define the document's layout
    • b) To include external stylesheets
    • c) To provide metadata about the document
    • d) To create a section for content

Answer: c) To provide metadata about the document

30.Which tag would you use to define a list item in an ordered list?

    • a) <li>
    • b) <ol>
    • c) <ul>
    • d) <item>

Answer: a) <li>

31.Which tag is used to include a title for a webpage that appears in the browser’s title bar or tab?

    • a) <meta>
    • b) <header>
    • c) <title>
    • d) <footer>

Answer: c) <title>

32.What is the default behavior of the <h1> to <h6> tags in HTML?

    • a) They are inline elements.
    • b) They are block-level elements with decreasing font size.
    • c) They create hyperlinks.
    • d) They add bullet points to the text.

Answer: b) They are block-level elements with decreasing font size.

33.How is the <body> tag positioned in relation to the <head> tag in an HTML document?

    • a) The <body> tag appears before the <head> tag.
    • b) The <body> tag appears after the <head> tag.
    • c) The <body> tag and <head> tag can appear in any order.
    • d) The <body> tag is a child of the <head> tag.

Answer: b) The <body> tag appears after the <head> tag.

34.Which HTML tag is used to create a bulleted list?

    • a) <ol>
    • b) <ul>
    • c) <li>
    • d) <list>

Answer: b) <ul>

35.What does the <footer> tag typically represent in an HTML document?

    • a) The section at the top of the page.
    • b) The section in the middle of the page.
    • c) The section at the bottom of the page.
    • d) A container for the main content.

Answer: c) The section at the bottom of the page.

36.Which tag is used to create a hyperlink in HTML?

    • a) <a>
    • b) <link>
    • c) <url>
    • d) <href>

Answer: a) <a>

37.To specify a URL for a hyperlink, which attribute of the <a> tag is used?

    • a) src
    • b) href
    • c) link
    • d) url

Answer: b) href

38.Which HTML tag is used to display an image on a webpage?

    • a) <img>
    • b) <image>
    • c) <picture>
    • d) <src>

Answer: a) <img>

39.What is the purpose of the alt attribute in the <img> tag?

    • a) To specify the image's width and height.
    • b) To provide alternative text for the image if it cannot be displayed.
    • c) To add a border around the image.
    • d) To create a link to another webpage.

Answer: b) To provide alternative text for the image if it cannot be displayed.

40.Which tag is used to create a table in HTML?

    • a) <table>
    • b) <tab>
    • c) <grid>
    • d) <tr>

Answer: a) <table>

41.Which tag is used to define a row in an HTML table?

    • a) <td>
    • b) <tr>
    • c) <th>
    • d) <row>

Answer: b) <tr>

42.How do you define a table cell that contains a header in an HTML table?

    • a) <td>
    • b) <th>
    • c) <header>
    • d) <cell>

Answer: b) <th>

43.Which tag is used to define a list within an HTML document?

    • a) <list>
    • b) <ol>
    • c) <ul>
    • d) <li>

Answer: d) <li>

44.How do you create a form in HTML?

    • a) <input>
    • b) <form>
    • c) <submit>
    • d) <button>

Answer: b) <form>

45.Which attribute of the <form> tag specifies the URL where the form data will be submitted?

    • a) action
    • b) method
    • c) url
    • d) target

Answer: a) action

46.Which attribute of the <input> tag specifies the type of input control?

    • a) value
    • b) type
    • c) name
    • d) placeholder

Answer: b) type

47.What does the type="submit" attribute do for an <input> element?

    • a) It creates a text field for user input.
    • b) It creates a button that submits the form data.
    • c) It displays a checkbox.
    • d) It creates a file input field.

Answer: b) It creates a button that submits the form data.

48.Which HTML tag is used to define a definition list?

    • a) <dl>
    • b) <list>
    • c) <def>
    • d) <ul>

Answer: a) <dl>

49.Which tags are used inside a definition list to define terms and descriptions?

    • a) <dt> and <dd>
    • b) <li> and <dl>
    • c) <term> and <desc>
    • d) <term> and <definition>

Answer: a) <dt> and <dd>

50.Which tag is used to create a clickable button in HTML?

    • a) <button>
    • b) <input>
    • c) <click>
    • d) <action>

Answer: a) <button>

 

Tags

Post a Comment

0Comments

Post a Comment (0)