Which HTML attribute is used to specify the height of an element?
a) height b) size c) width d) length
Correct Answer: a) height
Explanation: The height attribute is used to define the height of an element, typically in images and videos.
Question 42
Which HTML element is used to embed external content, such as documents or media players?
a) <embed> b) <iframe> c) <object> d) <div>
Correct Answer: c) <object>
Explanation: The <object> tag embeds external resources, such as multimedia files, plugins, or other web pages.
Question 43
What CSS property is used to define the space between lines of text?
a) letter-spacing b) line-height c) word-spacing d) text-spacing
Correct Answer: b) line-height
Explanation: The line-height property controls the vertical space between lines of text.
Question 44
Which HTML5 element is used to define a figure caption?
a) <figcaption> b) <caption> c) <legend> d) <summary>
Correct Answer: a) <figcaption>
Explanation: The <figcaption> tag defines a caption or description for the content within a <figure> element.
Question 45
What is the default method used when submitting an HTML form?
a) POST b) GET c) PUT d) DELETE
Correct Answer: b) GET
Explanation: The default form submission method is GET, where form data is appended to the URL as a query string.
Question 46
Which HTML element is used to define important text?
a) <strong> b) <b> c) <mark> d) <em>
Correct Answer: a) <strong>
Explanation: The <strong> tag defines important text, semantically indicating that the text should have strong emphasis.
Question 47
Which CSS property is used to change the appearance of text when hovering over it?
a) text-decoration b) hover-text c) text-align d) font-style
Correct Answer: a) text-decoration
Explanation: The text-decoration property can be used to change the appearance of text when it is hovered over, such as removing or adding an underline.
Question 48
Which tag is used to create an option in a drop-down list?
a) <select> b) <optgroup> c) <option> d) <input>
Correct Answer: c) <option>
Explanation: The <option> tag creates individual options in a drop-down list, contained within a <select> element.
Question 49
Which CSS property specifies the transparency of an element’s background, text, or border?
a) opacity b) visibility c) display d) alpha
Correct Answer: a) opacity
Explanation: The opacity property defines the transparency level of an element, where 0 is fully transparent and 1 is fully opaque.
Question 50
What is the correct HTML5 syntax for inserting an image?
a) <img href=”image.jpg” alt=”image description”> b) <img src=”image.jpg” alt=”image description”> c) <image src=”image.jpg” alt=”image description”> d) <src img=”image.jpg” alt=”image description”>
Correct Answer: b) <img src="image.jpg" alt="image description">
Explanation: The correct syntax for inserting an image in HTML5 is using the <img> tag with the src and alt attributes.