Skip to main content

Fundamentals of Front End Development MCQs with Answers

Practice important Fundamentals of Front End Development MCQs with answers and explanations.

Chapter: 31
Q341:
Fill in the blank: To change the color of a heading using inline CSS, you use the _______ property.
A. background-color
B. font-size
C. color
D. margin
Correct Answer: C
Chapter: 31
Q342:
Which of the following is not a method to include CSS in an HTML file?
A. External style sheet
B. Internal style sheet
C. Inline style
D. Style attribute
Correct Answer: D
Chapter: 32
Q343:
What does the background-color property specify?
A. Text color
B. Border color
C. Background color
D. Font style
Correct Answer: C
Chapter: 32
Q344:
Which CSS property is used to set an image as the background of an element?
A. background-color
B. background-image
C. background-position
D. background-repeat
Correct Answer: B
Chapter: 32
Q345:
By default, how does the background-image property behave?
A. Repeats the image horizontally only
B. Repeats the image vertically only
C. Does not repeat the image
D. Repeats the image both horizontally and vertically
Correct Answer: D
Chapter: 32
Q346:
Which CSS property is used to repeat an image only horizontally?
A. background-repeat: repeat-x;
B. background-position
C. background-repeat: no-repeat;
D. background-size
Correct Answer: A
Chapter: 32
Q347:
How can you ensure that a background image does not repeat?
A. background-repeat: repeat-x;
B. background-position
C. background-repeat: no-repeat;
D. background-image: none;
Correct Answer: C
Chapter: 32
Q348:
What is the shorthand property for setting all background properties in CSS?
A. background-color
B. background-image
C. background
D. background-repeat
Correct Answer: C
Chapter: 32
Q349:
Which of the following is the correct CSS syntax to apply a background color to a <p> element?
A. p {background-color: #e0ffff;}
B. p {background-image: #e0ffff;}
C. p {color: #e0ffff;}
D. p {border-color: #e0ffff;}
Correct Answer: A
Chapter: 32
Q350:
To set the position of a background image, which property is used?
A. background-color
B. background-image
C. background-position
D. background-repeat
Correct Answer: C
Chapter: 32
Q351:
The background-position property in CSS is used to:
A. Set the background color
B. Specify the image used as background
C. Set the position of a background image
D. Repeat the background image
Correct Answer: C
Chapter: 32
Q352:
The shorthand property "background" can be used to set which of the following?
A. Background color
B. Background image
C. Background position
D. All of the above
Correct Answer: D
Chapter: 33
Q353:
Which CSS property is used to set the color of text?
A. font-family
B. color
C. text-transform
D. background-color
Correct Answer: B
Chapter: 33
Q354:
What does the HEX value "#ff0000" represent in CSS?
A. Green color
B. Blue color
C. Black color
D. Red color
Correct Answer: D
Chapter: 33
Q355:
Which of the following is NOT a way to specify color in CSS?
A. HEX value
B. RGB value
C. HSL value
D. Font size
Correct Answer: D
Chapter: 33
Q356:
The default color for a page is defined in which CSS selector?
A. p
B. h1
C. body
D. div
Correct Answer: C
Chapter: 33
Q357:
Which CSS property is used to make all letters in a text uppercase?
A. text-indent
B. text-transform
C. text-decoration
D. font-style
Correct Answer: B
Chapter: 33
Q358:
What is the correct CSS syntax to transform text to uppercase?
A. p {text-transform: capitalize;}
B. p {text-transform: lowercase;}
C. p {text-transform: uppercase;}
D. p {text-transform: bold;}
Correct Answer: C
Chapter: 33
Q359:
How do you capitalize the first letter of each word in CSS?
A. text-indent
B. text-transform: capitalize;
C. font-family
D. text-align
Correct Answer: B
Chapter: 33
Q360:
Which CSS property specifies the indentation of the first line of a text or paragraph?
A. text-align
B. text-indent
C. margin-left
D. padding-left
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Fundamentals of Front End Development

🚀 Start Quiz Now