MCQs on Introduction to HTML | HTML

HTML (Hypertext Markup Language) is the standard language for creating web pages. This section covers basic concepts, such as the structure of an HTML document, DOCTYPE declaration, and setting up an HTML editor.

MCQs on HTML

Section 1: What is HTML?

  1. What does HTML stand for? a) Hyper Tool Markup Language
    b) Hyper Text Markup Language
    c) Hyperlink Text Marking Language
    d) High Text Marking Language
  2. What is the primary function of HTML?
    a) To format text
    b) To display multimedia files
    c) To structure content on the web
    d) To create programming logic
  3. Which of the following is the correct syntax for a basic HTML document?
    a) <html> </html>
    b) <!DOCTYPE html> <html> </html>
    c) <!DOCTYPE html> <body> </body>
    d) <html> <head> </head> </html>
  4. In HTML, which tag is used to define the title of a page?
    a) <header>
    b) <title>
    c) <heading>
    d) <footer>
  5. Which HTML tag is used to define an image?
    a) <img>
    b) <image>
    c) <picture>
    d) <src>

Section 2: Structure of an HTML Document

  1. What is the purpose of the <head> tag in an HTML document?
    a) To define the structure of the page
    b) To display the content of the page
    c) To contain metadata like title, styles, and scripts
    d) To hold text content
  2. Which of the following elements is mandatory in an HTML document?
    a) <header>
    b) <body>
    c) <html>
    d) <footer>
  3. In which part of the HTML document do you define the metadata?
    a) <body>
    b) <head>
    c) <footer>
    d) <html>
  4. What does the <body> tag in HTML define?
    a) The document’s footer
    b) The visible content of the web page
    c) The metadata of the page
    d) The structure of the web page
  5. Which tag is used to link external CSS files in HTML?
    a) <style>
    b) <link>
    c) <script>
    d) <css>

Section 3: DOCTYPE Declaration

  1. What is the role of the DOCTYPE declaration in HTML?
    a) To define the document type
    b) To define the language of the page
    c) To specify the HTML version used
    d) All of the above
  2. How do you declare the DOCTYPE for an HTML5 document?
    a) <!DOCTYPE HTML PUBLIC>
    b) <!DOCTYPE html>
    c) <!DOCTYPE HTML5>
    d) <!DOCTYPE html5>
  3. What happens if the DOCTYPE declaration is omitted in an HTML document?
    a) The page won’t load
    b) The browser uses the default HTML version
    c) The page becomes static
    d) The document will not display images
  4. Which of the following is true about the DOCTYPE declaration?
    a) It is case-sensitive
    b) It is not required in modern HTML
    c) It can be placed anywhere in the document
    d) It must be the first line of the document
  5. What is the main purpose of DOCTYPE in HTML?
    a) To specify the page’s title
    b) To specify the HTML version
    c) To link to external stylesheets
    d) To link to JavaScript files

Section 4: Setting Up an HTML Editor

  1. Which of the following is a popular code editor for HTML?
    a) Microsoft Word
    b) Notepad++
    c) Excel
    d) Adobe Photoshop
  2. What is the first step in setting up an HTML editor?
    a) Write the HTML code
    b) Choose a text editor or IDE
    c) Open the browser
    d) Install a web server
  3. Which of the following is required to run an HTML file locally?
    a) A web server
    b) A text editor
    c) A database
    d) A web browser
  4. Which feature is essential for an HTML editor to assist with code development?
    a) Syntax highlighting
    b) Image editing
    c) Video embedding
    d) File compression
  5. What is the advantage of using an IDE for HTML development?
    a) It automatically writes the code for you
    b) It provides additional features like autocompletion and debugging
    c) It is free to use
    d) It offers better page styling options

General HTML Questions

  1. Which tag is used to create a hyperlink in HTML?
    a) <a>
    b) <link>
    c) <href>
    d) <hyperlink>
  2. How do you define a paragraph in HTML?
    a) <p>
    b) <para>
    c) <text>
    d) <div>
  3. Which HTML tag is used to define a table?
    a) <table>
    b) <tr>
    c) <td>
    d) <thead>
  4. What is the default font color in an HTML document?
    a) Black
    b) White
    c) Blue
    d) Red
  5. How do you insert a comment in HTML?
    a) // comment
    b) /* comment */
    c) <!-- comment -->
    d) /* comment */
  6. Which tag is used to create an ordered list in HTML?
    a) <ul>
    b) <li>
    c) <ol>
    d) <list>
  7. Which attribute is used to specify the source of an image in HTML?
    a) src
    b) href
    c) alt
    d) link
  8. What does the <br> tag do in HTML?
    a) It breaks the line and starts a new paragraph
    b) It creates a new line within a paragraph
    c) It inserts a horizontal line
    d) It adds a background image
  9. Which tag is used to define a form in HTML?
    a) <form>
    b) <input>
    c) <textarea>
    d) <button>
  10. Which of the following HTML tags is used to define the largest heading?
    a) <h1>
    b) <h2>
    c) <h3>
    d) <heading>

Answers

QnoAnswer
1b) Hyper Text Markup Language
2c) To structure content on the web
3b) <!DOCTYPE html> <html> </html>
4b) <title>
5a) <img>
6c) To contain metadata like title, styles, and scripts
7c) <html>
8b) <head>
9b) The visible content of the web page
10b) <link>
11d) All of the above
12b) <!DOCTYPE html>
13b) The browser uses the default HTML version
14d) It must be the first line of the document
15b) To specify the HTML version
16b) Notepad++
17b) Choose a text editor or IDE
18d) A web browser
19a) Syntax highlighting
20b) It provides additional features like autocompletion and debugging
21a) <a>
22a) <p>
23a) <table>
24a) Black
25c) <!-- comment -->
26c) <ol>
27a) src
28b) It creates a new line within a paragraph
29a) <form>
30a) <h1>

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top