Multiple Choice Questions
Web Development: Full-Stack Applications
Topic: HTML
Grade: 10
Question 1:
Which of the following is NOT a valid HTML tag?
a)
Answer: d)
Explanation: The
Example:
Simple:
Complex:
Question 2:
Which of the following HTML tags is used to create a hyperlink?
a)
b)
c)
d)
tag is used to define a heading, and the
tag is used to define a paragraph.
Example:
Simple: Link creates a hyperlink to the website \”https://example.com\”.
Complex: Go to Section 2 creates a hyperlink that navigates to the section with the id \”section2\” on the same page.
Question 3:
Which attribute is used to provide alternative text for an image in HTML?
a) alt
b) src
c) href
d) title
Answer: a) alt
Explanation: The \”alt\” attribute is used to provide alternative text for an image in HTML. This text is displayed if the image fails to load or if it is read by screen readers for visually impaired users. The \”src\” attribute is used to specify the source (URL) of the image, the \”href\” attribute is used in anchor tags to specify the target of the link, and the \”title\” attribute provides additional information about the element.
Example:
Simple: displays the image \”image.jpg\” with the alternative text \”A beautiful sunset\”.
Complex: displays the image with the alternative text \”A beautiful sunset\” and a title attribute that provides additional information.
Question 4:
Which of the following is the correct way to add a comment in HTML?
a)
b) // This is a comment
c) ** This is a comment **
d) /* This is a comment */
Answer: a)
Explanation: Comments in HTML are added using the syntax. Everything between these tags is ignored by the browser and is not displayed on the webpage. Comments are used to add notes or explanations to the code for developers to understand it better. The other options are incorrect syntax for adding comments in HTML.
Example:
Simple: adds a comment that is not displayed on the webpage.
Complex: provides a comment that helps other developers understand the code better.
Question 5:
Which HTML tag is used to display a line break without starting a new paragraph?
a)
b)
c)
d)
Answer: a)
Explanation: The
tag is used to insert a line break in HTML without starting a new paragraph. It is a self-closing tag and does not require a closing tag. The
tag is used to define a paragraph, the
tag is used to insert a horizontal rule, and the
Example:
Simple: This is
a line break. displays \”This is\” followed by a line break and then \”a line break\” on a new line.
Complex:
This is a paragraph.
This is another line.
displays \”This is a paragraph.\” followed by a line break and then \”This is another line.\” within the same paragraph.