HTML/CSS MCQ

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

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 of the following CSS properties defines the various border properties of an element’s four sides in a single declaration?

A border-collapse

B border-width

C padding

D border

B
The border-width property defines the width of an element’s four borders. This property can have one to four values. Example:

div1 {
  border-width: thick;
}
div2 {
  border-width: 0 4px 8px 12px;
}
 

2. Which of the following CSS properties defines the font size of the text?

A font-size

B text-size

C text

D size

A
The font-size property defines the size of the text. Example:

h1 {
  font-size: 40px;
}
 

3. Which of the following CSS properties defines the shadow of a box-type element?

A set-shadow

B box-shadow

C shadow

D canvas-shadow

B
The box-shadow property allows you to attach one or more shadows to an element. See an example.
 
 

4. Which of the following values is appropriate for the overflow property?

A scroll

B hidden

C auto

D all of the mentioned

D
The CSS overflow property controls what happens to content that is too large to fit in an area. The overflow property can take the following values: visible | hidden | scroll | auto | initial | inherit. See an example.
 

5. Which of the following CSS properties is used to specify table borders in CSS?

A table:border

B table

C border

D None of the mentioned

C
In CSS, the border property is used to specify the borders of tables. Example:

table { border: 5px solid black; }
 

6. Which of the following properties is used to align text in a table?

A text-align

B align-table

C text-table

D None of these properties

A
In CSS, the text-align property is used to align text inside a table. Example:

table { text-align: left; }
 
 

7. Which of the following CSS properties defines the space between table cells?

A border-spacing

B border-style

C border

D None of the mentioned properties

A
In CSS, the border-spacing property defines the space between cells in a table. See an example.
 

8. Which of the following CSS3 properties can be used to allow line breaks inside words?

A line-break

B line-wrap

C word-wrap

D word-break

D
The word-break property can be used to allow line breaks inside words. See an example.
 

9. What is the general syntax of the var() function?

A var(–name, value)

B var(–name)

C var(value)

D None of these answers

A
var(--name, value) is the correct syntax for writing the var() function.
 
 

10. Which of the following properties allows text to be converted to uppercase or lowercase?

A text-transform

B text-convert

C text-decoration

D text-uppercase

A
The text-transform property is used to specify uppercase and lowercase text transformations. Example:

div.a {
  text-transform: uppercase;  /* majuscules */
}

div.b {
  text-transform: lowercase;  /* minuscules */
}

div.c {
  text-transform: capitalize;  /* capital */
}
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 *