HTML MCQ Quiz - Objective Question with Answer for HTML - Download Free PDF
Last updated on Jan 20, 2023
Latest HTML MCQ Objective Questions
HTML Question 1:
Which of the following is NOT a pair tag in HTML?
Answer (Detailed Solution Below)
HTML Question 1 Detailed Solution
tag
It is used to embed an image on an HTML page. The tag has two required attributes:
src - Specifies the path to the image
alt - Specifies an alternate text for the image, if the image for some reason cannot be displayed
Syntax
Example
tag
The content inside is typically displayed in italic.
tag
It defines a paragraph. Browsers automatically add a single blank line before and after each
element.
Example:
This is some text in a paragraph.
It defines the title of the document. The title must be text-only, and it is shown in the browser's title bar or in the page's tab. It cannot have more than one
HTML Question 2:
Html document must always be saved with which of the following?
Answer (Detailed Solution Below)
HTML Question 2 Detailed Solution
The correct option is (4)
both .html and .htm
Key Points
- Although HTML files are simply plain ASCII text, they all need to have a specific file extension in order for web browsers to recognize them. It ends with either.htm or.html.
- Based on a file containing hypertext markup language, an HTML document is created. In HTML, tags, or hidden keywords, specify how text should be shown to processing programs, frequently Web browsers.
- Typically, an HTML document is composed of two parts: The HTML document's HEAD section contains descriptive information. Everything you want to appear on the Web page is in the BODY section.
- The building blocks of web pages, HTML, are used to make websites and web applications.
- An HTML 4.0 document typically consists of three sections: a line with version information, a header section that describes the document's content, and a body.
- Text, the words you want to appear on your page, and embedded instructions known as HTML tags make up an HTML file.
HTML Question 3:
Which of the statements given below is/are correct?
It is always important and useful to include an 'alt' attribute on 'img' tag in HTML because
A. users who cannot see the image due to vision impairment can have a textual description of the image (which can be spoken aloud by a screenreader).
B. If the image fails to load (slow connection, broken path, etc.) then alt text is displayed instead.
C. SEO (Search Engine Optimization) benefits.
Choose the correct answer from the options given below :
Answer (Detailed Solution Below)
HTML Question 3 Detailed Solution
The correct answer is option 4.
Explanation:
It is always important and useful to include an 'alt' attribute on 'img' tag in HTML because
- users who cannot see the image due to vision impairment can have a textual description of the image (which can be spoken aloud by a screen reader).
- If the image fails to load (slow connection, broken path, etc.) then alt text is displayed instead.
- SEO (Search Engine Optimization) benefits.
HTML Question 4:
Which of the following is NOT a pair tag in HTML?
Answer (Detailed Solution Below)
HTML Question 4 Detailed Solution
tag
It is used to embed an image on an HTML page. The tag has two required attributes:
src - Specifies the path to the image
alt - Specifies an alternate text for the image, if the image for some reason cannot be displayed
Syntax
Example
tag
The content inside is typically displayed in italic.
tag
It defines a paragraph. Browsers automatically add a single blank line before and after each
element.
Example:
This is some text in a paragraph.
It defines the title of the document. The title must be text-only, and it is shown in the browser's title bar or in the page's tab. It cannot have more than one
HTML Question 5:
The ______ is a set of standards that defines how a dynamic web document should be written, how input data should be supplied to the program, and how the output result should be used.
Answer (Detailed Solution Below)
HTML Question 5 Detailed Solution
Common Gateway Interface (CGI) is a set of standards that defines how a dynamic web document should be written, how to input data should be supplied to the program, and how the output result should be used.
- CGI is often used to process inputs information from the user and produce the appropriate output.
- The only requirement for being able to act as a CGI program is the ability to read from Standard Input (stdin), or the ability to access Environment variables. Access to CGI programs and scripts must be made via the "cgiwrap" process.
- CGI stands for Common Gateway Interface and provides an interface between the HTTP server and programs generating web content. These programs are better known as CGI scripts. They are written in a scripting language. The output from a CGI function is sent to the web client (browser) as a part of the web page.
Hence the correct answer is Common Gateway Interface.Additional Information
- The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets and scripting languages such as JavaScript.
- The File Transfer Protocol is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. FTP is built on a client-server model architecture using separate control and data connections between the client and the server.
Top HTML MCQ Objective Questions
Which among the following is not an HTML tag?
Answer (Detailed Solution Below)
HTML Question 6 Detailed Solution
Download Solution PDFThe correct answer is .
Key Points
- is not an HTML tag.
- However,
- tag
is used to insert data under the list.- stands or list index it contains the list items.
Important Points
- The element is used to create a drop-down list.
- The
- The tag specifies an input field where the user can enter data.
- The tag defines a multi-line text input control.
- The
In an HTML page, the tag defines a hyperlink, and its ______ attribute specifies the URL of the page the link goes to.
Answer (Detailed Solution Below)
HTML Question 7 Detailed Solution
Download Solution PDFIn an HTML page,the and elements, the href attribute specifies the URL of the page the link goes to.
For
For elements, the href attribute specifies the location (URL) of the external resource.
Example:
The href attribute specifies the link's destination:
Hence the correct answer is Href.
Which tag is used to enclose any number of javascript statements in HTML document?
Answer (Detailed Solution Below)
HTML Question 8 Detailed Solution
Download Solution PDFConcept:
Javascript is a programming language for use in HTML pages. Its programs are run by interpreter built into the user’s web browser.
Explanation:
Programs in javascript language are known as scripts. It can execute both on browser and server or any device that supports special program javascript virtual machine. It has full integration with HTML/CSS.
Javascript programs can be inserted into any part of HTML document with the help of