Q31. How do you make a table cell span multiple rows?
a) rowspan=”number”
b) span=”number”
c) colspan=”number”
d) cellspan=”number”
Show Answer
Correct Answer: a) rowspan=”number”
Explanation: The rowspan attribute in a table cell specifies the number of rows a cell should span. It allows a cell to extend vertically across multiple rows.
Q32. What does the alt attribute provide in an <img> tag?
a) The link to the image
b) The size of the image
c) Alternative text for the image
d) The caption for the image
Show Answer
Correct Answer: c) Alternative text for the image
Explanation: The alt attribute provides alternative text for an image. This text is displayed if the image cannot be loaded and helps with accessibility.
Q33. Which tag is used to group header content in a table?
a) <thead>
b) <tfoot>
c) <tbody>
d) <header>
Show Answer
Correct Answer: a) <thead>
Explanation: The <thead> tag is used to group header content in a table. It helps organize and define the header rows.
Q34. How do you create a bulleted list in HTML?
a) <list>
b) <ul>
c) <ol>
d) <dl>
Show Answer
Correct Answer: b) <ul>
Explanation: To create a bulleted (unordered) list in HTML, use the <ul> tag. The list items are defined with the <li> tag.
Q35. Which HTML tag is used to define a section of content that is important for the document’s structure but not standalone?
a) <section>
b) <div>
c) <aside>
d) <main>
Show Answer
Correct Answer: b) <div>
Explanation: The <div> tag is used to define a generic container for grouping and styling content. It does not convey any specific meaning about the content, unlike <section>, <aside>, or <main>.
Q36. What is the purpose of the method attribute in an HTML form?
a) To specify how the form data is sent to the server
b) To specify the form’s visual style
c) To define the form’s action URL
d) To create a form button
Show Answer
Correct Answer: a) To specify how the form data is sent to the server
Explanation: The method attribute in an HTML form specifies the HTTP method used to send form data to the server, such as GET or POST.
Q37. How do you specify a specific style for a single HTML element?
a) Use inline CSS
b) Use an external stylesheet
c) Use a CSS class
d) Use a CSS ID
Show Answer
Correct Answer: a) Use inline CSS
Explanation: To apply specific styles to a single HTML element, you can use inline CSS by adding the style attribute directly to the element. This method applies the styles only to that particular element.
Q38. What does the <span> tag do in HTML?
a) Defines a block-level container
b) Defines an inline container
c) Defines a form element
d) Defines a section header
Show Answer
Correct Answer: b) Defines an inline container
Explanation: The <span> tag is used to define an inline container for styling or scripting purposes. It does not create a new block and is used to apply styles to a specific portion of text.
Q39. What is the correct way to specify a color in CSS?
a) color: rgb(255, 0, 0);
b) color: red;
c) color: #ff0000;
d) All of the above
Show Answer
Correct Answer: d) All of the above
Explanation: In CSS, you can specify a color using various methods, including color names (e.g., red), RGB values (e.g., rgb(255, 0, 0)), or hex codes (e.g., #ff0000).
Q40. How do you include a JavaScript file in an HTML document?
a) <script src=”file.js”></script>
b) <script href=”file.js”></script>
c) <js src=”file.js”></js>
d) <link src=”file.js” type=”text/javascript”>
Show Answer
Correct Answer: a) <script src=”file.js”></script>
Explanation: To include an external JavaScript file, use the <script> tag with the src attribute pointing to the JavaScript file. This allows the HTML document to execute the JavaScript code.