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?
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
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
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>
In HTML, which tag is used to define the title of a page? a) <header> b) <title> c) <heading> d) <footer>
Which HTML tag is used to define an image? a) <img> b) <image> c) <picture> d) <src>
Section 2: Structure of an HTML Document
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
Which of the following elements is mandatory in an HTML document? a) <header> b) <body> c) <html> d) <footer>
In which part of the HTML document do you define the metadata? a) <body> b) <head> c) <footer> d) <html>
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
Which tag is used to link external CSS files in HTML? a) <style> b) <link> c) <script> d) <css>
Section 3: DOCTYPE Declaration
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
How do you declare the DOCTYPE for an HTML5 document? a) <!DOCTYPE HTML PUBLIC> b) <!DOCTYPE html> c) <!DOCTYPE HTML5> d) <!DOCTYPE html5>
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
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
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
Which of the following is a popular code editor for HTML? a) Microsoft Word b) Notepad++ c) Excel d) Adobe Photoshop
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
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
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
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
Which tag is used to create a hyperlink in HTML? a) <a> b) <link> c) <href> d) <hyperlink>
How do you define a paragraph in HTML? a) <p> b) <para> c) <text> d) <div>
Which HTML tag is used to define a table? a) <table> b) <tr> c) <td> d) <thead>
What is the default font color in an HTML document? a) Black b) White c) Blue d) Red
How do you insert a comment in HTML? a) // comment b) /* comment */ c) <!-- comment --> d) /* comment */
Which tag is used to create an ordered list in HTML? a) <ul> b) <li> c) <ol> d) <list>
Which attribute is used to specify the source of an image in HTML? a) src b) href c) alt d) link
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
Which tag is used to define a form in HTML? a) <form> b) <input> c) <textarea> d) <button>
Which of the following HTML tags is used to define the largest heading? a) <h1> b) <h2> c) <h3> d) <heading>
Answers
Qno
Answer
1
b) Hyper Text Markup Language
2
c) To structure content on the web
3
b) <!DOCTYPE html> <html> </html>
4
b) <title>
5
a) <img>
6
c) To contain metadata like title, styles, and scripts
7
c) <html>
8
b) <head>
9
b) The visible content of the web page
10
b) <link>
11
d) All of the above
12
b) <!DOCTYPE html>
13
b) The browser uses the default HTML version
14
d) It must be the first line of the document
15
b) To specify the HTML version
16
b) Notepad++
17
b) Choose a text editor or IDE
18
d) A web browser
19
a) Syntax highlighting
20
b) It provides additional features like autocompletion and debugging