HTML/CSS MCQ

HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 20

Multiple choice questions and answers (MCQs) on HTML/CSS to prepare for exams, tests, and certifications. These questions are taken from a real written exam and some parts are taken from an interview. So you will find questions on basic techniques such as tags, web standards, CSS selector, objects, and more. This quiz will easily prepare anyone to pass their online test.
 
 

1. Which CSS property allows you to position an element in a fixed way relative to the browser window?

A position: absolute;

B position: fixed;

C position: relative;

D position: sticky;

B
The property position: fixed; positions an element relative to the browser window, meaning the element stays fixed even when the page is scrolled. See a complete example.
 

2. Which HTML tag is used to create an email input field?

A <input type="email">

B <input type="text">

C <input type="url">

D <input type="password">

A
The element <input type="email"> creates an input field specifically for collecting email addresses.
 

3. Which CSS property is used to specify the font style?

A font-family

B font-style

C font-size

D font-weight

B
The property font-style allows you to specify the font style, such as ‘italic’ for italics or ‘normal’ for the default font style.
 
 

4. Which HTML tag is used to define a level 1 heading in a webpage?

A <h1>

B <title>

C <h2>

D <heading>

A
The <h1> tag is used to define a level 1 heading in an HTML page, typically used for the main title of the page.
 

5. Which HTML tag is used to allow a user to upload a file?

A <form type="file">

B <file>

C <input type="upload">

D <input type="file">

D
The <input type="file"> element allows the user to select and upload a file from their device. Example:
 

6. What is the most commonly used character encoding in HTML?

A ISO-8859-1

B UTF-8

C ASCII

D Windows-1252

B
The UTF-8 encoding is the most widely used in HTML documents. It allows for the representation of all possible characters, including symbols and international characters.
 
 

7. Which CSS property allows you to set rounded corners for an element?

A border-radius

B corner-radius

C border-curve

D round-corner

A
The border-radius property is used to create rounded corners for an element. For example, border-radius: 10px; rounds the corners of an element by 10 pixels.
 

8. How do you create a link that directs the user to a specific section of a page?

A <a href="page#section">

B <a href="section">

C <a href="#section">

D <a href="section#">

C
The href="#section" creates a link to a specific identifier in the same page. The target element must have an id="section" attribute.
 

9. Which CSS property allows you to change the style of list bullets?

A list-style

B bullet-style

C list-type

D marker-style

A
The list-style property allows you to customize the bullets in lists. For example, list-style: square; changes the default bullets to squares. See a complete example.
 
 

10. Which HTML tag is used to create a select list with multiple options in a form?

A <select multiple>

B <select>

C <option multiple>

D <select multi>

A
The <select multiple> tag allows the user to select multiple options in a dropdown menu. See a complete example.
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *