MCQ on HTML Programming Basics | NIELIT ECC

Advertisement

Q21. How do you specify the font size in CSS?
a) font-size: size;
b) text-size: size;
c) size: font;
d) text-font: size;

Show Answer

Correct Answer: a) font-size: size;
Explanation: To specify the font size in CSS, use the font-size property. You can set it using various units like pixels, ems, or percentages.

Q22. Which tag is used to create a text area in a form?
a) <input type=”text”>
b) <textarea>
c) <field>
d) <box>

Show Answer

Correct Answer: b) <textarea>
Explanation: The <textarea> tag is used to create a multi-line text input field in a form. It allows users to input larger amounts of text.

Q23. What is the purpose of the action attribute in a form?
a) To specify the HTTP method for form submission
b) To specify where to send the form data
c) To define the form’s visual style
d) To create a form button

Show Answer

Correct Answer: b) To specify where to send the form data
Explanation: The action attribute in a form specifies the URL to which the form data should be sent when the form is submitted. It determines the server-side script or endpoint that will process the data.

Q24. How do you create a drop-down list in HTML?
a) <select>
b) <dropdown>
c) <list>
d) <option>

Show Answer

Correct Answer: a) <select>
Explanation: To create a drop-down list in HTML, use the <select> tag. The <option> tag is used inside <select> to define the options available in the drop-down list.

Q25. What does the target attribute specify in a hyperlink?
a) The URL of the link
b) The text of the link
c) Where to open the linked document
d) The style of the link

Show Answer

Correct Answer: c) Where to open the linked document
Explanation: The target attribute specifies where to open the linked document. Common values are _blank for a new window or tab, and _self for the same frame or window.

Q26. Which tag is used to create a line break in HTML?
a) <break>
b) <line>
c) <br>
d) <newline>

Show Answer

Correct Answer: c) <br>
Explanation: The <br> tag is used to create a line break within text, forcing the subsequent content to appear on a new line.

Q27. What does the <footer> tag represent in HTML?
a) The top section of a webpage
b) The main content of a webpage
c) The bottom section of a webpage
d) A section for images

Show Answer

Correct Answer: c) The bottom section of a webpage
Explanation: The <footer> tag is used to define the bottom section of a webpage. It often contains information like copyright notices, contact details, and navigation links.

Q28. How do you specify an external CSS file in an HTML document?
a) <style src=”styles.css”>
b) <css href=”styles.css”>
c) <link rel=”stylesheet” type=”text/css” href=”styles.css”>
d) <stylesheet href=”styles.css”>

Show Answer

Correct Answer: c) <link rel=”stylesheet” type=”text/css” href=”styles.css”>
Explanation: To include an external CSS file, use the <link> tag with rel=”stylesheet” and href attributes. This method links the CSS file to the HTML document.

Q29. Which HTML element is used to define a section of content that could be considered standalone?
a) <div>
b) <section>
c) <article>
d) <span>

Show Answer

Correct Answer: c) <article>
Explanation: The <article> element is used to define a section of content that could stand alone or be reused. It is often used for blog posts, news articles, or similar content.

Q30. What is the correct syntax to create a checkbox input in HTML?
a) <input type=”checkbox”>
b) <checkbox>
c) <input type=”check”>
d) <check>

Show Answer

Correct Answer: a) <input type=”checkbox”>
Explanation: To create a checkbox input in HTML, use the <input> tag with type=”checkbox”. This creates a checkable box that users can select or deselect.

Advertisement
error: Content is protected !!
Scroll to Top