100+ CSS Questions test your skills and knowledge on CSS

#CSS #CascadingStyleSheets #WebDesign #FrontEnd #CSS3 #CSSGrid #ResponsiveDesign #Quiz #Trivia #KnowledgeChallenge #BrainTeaser #QuizTime #FunFacts #LearningMadeFun #TestYourKnowledge

Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to create a border around an element in CSS?
Which property is used to set the height of an element in CSS?
Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to create a border around an element in CSS?
Which property is used to set the height of an element in CSS?
Which property is used to specify the position of an element in CSS?
Which property is used to add space between the content and the border of an element in CSS?
Which property is used to make text bold in CSS?
Which property is used to control the visibility of an element in CSS?
Which property is used to create an underline beneath text in CSS?
Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to create a border around an element in CSS?
Which property is used to set the height of an element in CSS?
Which property is used to specify the position of an element in CSS?
Which property is used to add space between the content and the border of an element in CSS?
Which property is used to make text bold in CSS?
Which property is used to control the visibility of an element in CSS?
Which property is used to create an underline beneath text in CSS?
Which property is used to add space between the content and the border of an element in CSS?
Which property is used to make text bold in CSS?
Which property is used to control the visibility of an element in CSS?
Which property is used to create an underline beneath text in CSS?
Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to create a border around an element in CSS?
Which property is used to set the height of an element in CSS?
Which property is used to specify the position of an element in CSS?
Which property is used to add space between the content and the border of an element in CSS?
Which property is used to make text bold in CSS?
Which property is used to control the visibility of an element in CSS?
Which property is used to create an underline beneath text in CSS?
Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to create a border around an element in CSS?
Which property is used to set the height of an element in CSS?
Which property is used to specify the position of an element in CSS?
Which property is used to add space between the content and the border of an element in CSS?
Which property is used to make text bold in CSS?
Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to create a border around an element in CSS?
Which property is used to set the height of an element in CSS?
Which property is used to specify the position of an element in CSS?
Which property is used to add space between the content and the border of an element in CSS?
Which property is used to make text bold in CSS?
Which property is used to control the visibility of an element in CSS?
Which property is used to create an underline beneath text in CSS?
Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to create a border around an element in CSS?
Which property is used to set the height of an element in CSS?
Which property is used to specify the position of an element in CSS?
Which property is used to add space between the content and the border of an element in CSS?
Which property is used to make text bold in CSS?
Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to create a border around an element in CSS?
Which property is used to set the height of an element in CSS?
Which property is used to specify the position of an element in CSS?
Which property is used to add space between the content and the border of an element in CSS?
Which property is used to make text bold in CSS?
Which property is used to control the visibility of an element in CSS?
Which property is used to create an underline beneath text in CSS?
Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to create a border around an element in CSS?
Which property is used to set the height of an element in CSS?
Which property is used to specify the position of an element in CSS?
Which property is used to add space between the content and the border of an element in CSS?
Which property is used to make text bold in CSS?
Which property is used to control the visibility of an element in CSS?
Which property is used to create an underline beneath text in CSS?
Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to create a border around an element in CSS?
Which property is used to set the height of an element in CSS?
Which property is used to specify the position of an element in CSS?
Which property is used to add space between the content and the border of an element in CSS?
Which property is used to make text bold in CSS?
Which property is used to control the visibility of an element in CSS?
Which property is used to create an underline beneath text in CSS?
Which property is used to set the background color of an element in CSS?
Which property is used to set the font family in CSS?
Which property is used to align text within an element in CSS?
Which property is used to create a border around an element in CSS?

100+ CSS Questions test your skills and knowledge on CSS

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Explanation: The background-color property is used to set the background color of an element in CSS.

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Explanation: The font-family property is used to set the font family of an element in CSS.

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Explanation: The text-align property is used to align text within an element in CSS.

Which property is used to create a border around an element in CSS?

a) border-color

b) border

c) border-style

d) border-width

Answer: b) border

Explanation: The border property is used to create a border around an element in CSS. It combines the border-color, border-style, and border-width properties.

Which property is used to set the height of an element in CSS?

a) height

b) width

c) size

d) length

Answer: a) height

Explanation: The height property is used to set the height of an element in CSS.

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Explanation: The background-color property is used to set the background color of an element in CSS. It takes a color value as its input.

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Explanation: The font-family property is used to set the font family of an element in CSS. It takes a list of font names as its input, and the browser will use the first font that is available on the user’s system.

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Explanation: The text-align property is used to align text within an element in CSS. It takes values such as left, center, right, and justify.

Which property is used to create a border around an element in CSS?

a) border-color

b) border

c) border-style

d) border-width

Answer: b) border

Explanation: The border property is used to create a border around an element in CSS. It is a shorthand property that can be used to set the border-width, border-style, and border-color properties at the same time.

Which property is used to set the height of an element in CSS?

a) height

b) width

c) size

d) length

Answer: a) height

Explanation: The height property is used to set the height of an element in CSS. It takes a length value as its input, such as 100px or 50%.

Which property is used to specify the position of an element in CSS?

a) place

b) location

c) position

d) placement

Answer: c) position

Explanation: The position property is used to specify the position of an element in CSS. It takes values such as static, relative, absolute, and fixed.

Which property is used to add space between the content and the border of an element in CSS?

a) padding

b) margin

c) space

d) gutter

Answer: a) padding

Explanation: The padding property is used to add space between the content and the border of an element in CSS. It takes values such as 10px or 1em.

Which property is used to make text bold in CSS?

a) font-size

b) font-weight

c) font-style

d) font-variant

Answer: b) font-weight

Explanation: The font-weight property is used to make text bold in CSS. It takes values such as normal, bold, bolder, and lighter.

Which property is used to control the visibility of an element in CSS?

a) display

b) visibility

c) opacity

d) hidden

Answer: b) visibility

Explanation: The visibility property is used to control the visibility of an element in CSS. It takes values such as visible, hidden, collapse, and inherit.

Which property is used to create an underline beneath text in CSS?

a) text-decoration

b) text-transform

c) text-shadow

d) text-underline

Answer: a) text-decoration

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Which property is used to create a border around an element in CSS?

a) border-color

b) border

c) border-style

d) border-width

Answer: b) border

Which property is used to set the height of an element in CSS?

a) height

b) width

c) size

d) length

Answer: a) height

Which property is used to specify the position of an element in CSS?

a) place

b) location

c) position

d) placement

Answer: c) position

Which property is used to add space between the content and the border of an element in CSS?

a) padding

b) margin

c) space

d) gutter

Answer: a) padding

Which property is used to make text bold in CSS?

a) font-size

b) font-weight

c) font-style

d) font-variant

Answer: b) font-weight

Which property is used to control the visibility of an element in CSS?

a) display

b) visibility

c) opacity

d) hidden

Answer: b) visibility

Which property is used to create an underline beneath text in CSS?

a) text-decoration

b) text-transform

c) text-shadow

d) text-underline

Answer: a) text-decoration

Which property is used to add space between the content and the border of an element in CSS?

a) padding

b) margin

c) space

d) gutter

Answer: a) padding

Explanation: The padding property is used to add space between the content and the border of an element in CSS.

Which property is used to make text bold in CSS?

a) font-size

b) font-weight

c) font-style

d) font-variant

Answer: b) font-weight

Explanation: The font-weight property is used to make text bold in CSS.

Which property is used to control the visibility of an element in CSS?

a) display

b) visibility

c) opacity

d) hidden

Answer: b) visibility

Explanation: The visibility property is used to control the visibility of an element in CSS.

Which property is used to create an underline beneath text in CSS?

a) text-decoration

b) text-transform

c) text-shadow

d) text-underline

Answer: a) text-decoration

Explanation: The text-decoration property is used to add or remove decoration from text in CSS. It can be set to underline, overline, line-through, or none.

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Explanation: The background-color property is used to set the background color of an element in CSS.

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Explanation: The font-family property is used to set the font family of an element in CSS.

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Explanation: The text-align property is used to align text within an element in CSS.

Which property is used to create a border around an element in CSS?

a) border-color

b) border

c) border-style

d) border-width

Answer: b) border

Explanation: The border property is used to create a border around an element in CSS.

Which property is used to set the height of an element in CSS?

a) height

b) width

c) size

d) length

Answer: a) height

Explanation: The height property is used to set the height of an element in CSS.

Which property is used to specify the position of an element in CSS?

a) place

b) location

c) position

d) placement

Answer: c) position

Explanation: The position property is used to specify the position of an element in CSS.

Which property is used to add space between the content and the border of an element in CSS?

a) padding

b) margin

c) space

d) gutter

Answer: a) padding

Explanation: The padding property is used to add space between the content and the border of an element in CSS.

Which property is used to make text bold in CSS?

a) font-size

b) font-weight

c) font-style

d) font-variant

Answer: b) font-weight

Explanation: The font-weight property is used to make text bold in CSS.

Which property is used to control the visibility of an element in CSS?

a) display

b) visibility

c) opacity

d) hidden

Answer: b) visibility

Explanation: The visibility property is used to control the visibility of an element in CSS.

Which property is used to create an underline beneath text in CSS?

a) text-decoration

b) text-transform

c) text-shadow

d) text-underline

Answer: a) text-decoration

Explanation: The text-decoration property is used to create an underline beneath text in CSS.

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Explanation: The background-color property sets the background color of an element in CSS.

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Explanation: The font-family property sets the font family of an element in CSS.

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Explanation: The background-color property is used to set the background color of an element in CSS. This property takes a color value as its argument and can be used to set the background color of an entire page or a specific element.

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Explanation: The font-family property is used to set the font family of an element in CSS. This property takes one or more font family names as its argument and can be used to set the font family for an entire page or a specific element.

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Explanation: The text-align property is used to align text within an element in CSS. This property takes one of several values, including left, center, right, and justify, and can be used to align text within an entire page or a specific element.

Which property is used to create a border around an element in CSS?

a) border-color

b) border

c) border-style

d) border-width

Answer: b) border

Explanation: The border property is used to create a border around an element in CSS. This property can take up to three values, representing the width, style, and color of the border, and can be used to create a border for an entire page or a specific element.

Which property is used to set the height of an element in CSS?

a) height

b) width

c) size

d) length

Answer: a) height

Explanation: The height property is used to set the height of an element in CSS. This property takes a length value as its argument and can be used to set the height of an entire page or a specific element.

Which property is used to specify the position of an element in CSS?

a) place

b) location

c) position

d) placement

Answer: c) position

Explanation: The position property is used to specify the position of an element in CSS. This property takes one of several values, including static, relative, absolute, and fixed, and can be used to position an element within an entire page or a specific container.

Which property is used to add space between the content and the border of an element in CSS?

a) padding

b) margin

c) space

d) gutter

Answer: a) padding

Explanation: The padding property is used to add space between the content and the border of an element in CSS. This property can take up to four values, representing the top, right, bottom, and left padding, and can be used to add padding to an entire page or a specific element.

Which property is used to make text bold in CSS?

a) font-size

b) font-weight

c) font-style

d) font-variant

Answer: b) font-weight

Explanation: The font-weight property is used to make text bold in CSS. This property takes a numerical value or one of several keywords, including normal, bold, bolder, and lighter, and can be used to set the weight of the font for an entire page or a specific element.

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Explanation: The background-color property is used to set the background color of an element in CSS. It takes a color value as its argument.

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Explanation: The font-family property is used to set the font family of an element in CSS. It takes a font family name or a list of font family names as its argument.

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Explanation: The text-align property is used to align text within an element in CSS. It takes one of the following values: left, right, center, justify, or inherit.

Which property is used to create a border around an element in CSS?

a) border-color

b) border

c) border-style

d) border-width

Answer: b) border

Explanation: The border property is used to create a border around an element in CSS. It takes three values: border-width, border-style, and border-color.

Which property is used to set the height of an element in CSS?

a) height

b) width

c) size

d) length

Answer: a) height

Explanation: The height property is used to set the height of an element in CSS. It takes a length value as its argument.

Which property is used to specify the position of an element in CSS?

a) place

b) location

c) position

d) placement

Answer: c) position

Explanation: The position property is used to specify the position of an element in CSS. It takes one of the following values: static, relative, absolute, fixed, or sticky.

Which property is used to add space between the content and the border of an element in CSS?

a) padding

b) margin

c) space

d) gutter

Answer: a) padding

Explanation: The padding property is used to add space between the content and the border of an element in CSS. It takes one to four length values as its argument.

Which property is used to make text bold in CSS?

a) font-size

b) font-weight

c) font-style

d) font-variant

Answer: b) font-weight

Explanation: The font-weight property is used to make text bold in CSS. It takes one of the following values: normal, bold, bolder, lighter, 100-900, or inherit.

Which property is used to control the visibility of an element in CSS?

a) display

b) visibility

c) opacity

d) hidden

Answer: b) visibility

Explanation: The visibility property is used to control the visibility of an element in CSS. It takes one of the following values: visible, hidden, collapse, or inherit.

Which property is used to create an underline beneath text in CSS?

a) text-decoration

b) text-transform

c) text-shadow

d) text-underline

Answer: a) text-decoration

Explanation: The text-decoration property is used to create an underline beneath text in CSS. It takes one or more values, such as underline, overline, line-through, or none.

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Explanation: The “background-color” property is used to set the background color of an element in CSS. This property takes a color value as its parameter, and can be applied to any HTML element.

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Explanation: The “font-family” property is used to set the font family in CSS. This property takes a list of font family names as its parameter, and can be applied to any HTML element.

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Explanation: The “text-align” property is used to align text within an element in CSS. This property takes a keyword value (left, right, center, justify, or inherit) as its parameter, and can be applied to any HTML element.

Which property is used to create a border around an element in CSS?

a) border-color

b) border

c) border-style

d) border-width

Answer: b) border

Explanation: The “border” property is used to create a border around an element in CSS. This property takes three values (width, style, and color) as its parameters, and can be applied to any HTML element.

Which property is used to set the height of an element in CSS?

a) height

b) width

c) size

d) length

Answer: a) height

Explanation: The “height” property is used to set the height of an element in CSS. This property takes a length value as its parameter, and can be applied to any HTML element.

Which property is used to specify the position of an element in CSS?

a) place

b) location

c) position

d) placement

Answer: c) position

Explanation: The “position” property is used to specify the position of an element in CSS. This property takes a keyword value (static, relative, absolute, fixed, or sticky) as its parameter, and can be applied to any HTML element.

Which property is used to add space between the content and the border of an element in CSS?

a) padding

b) margin

c) space

d) gutter

Answer: a) padding

Explanation: The “padding” property is used to add space between the content and the border of an element in CSS. This property takes one to four length values as its parameters, and can be applied to any HTML element.

Which property is used to make text bold in CSS?

a) font-size

b) font-weight

c) font-style

d) font-variant

Answer: b) font-weight

Explanation: The “font-weight” property is used to make text bold in CSS. This property takes a numeric value (100 to 900, in increments of 100) or a keyword value (normal, bold, bolder, or lighter) as its parameter, and can be applied to any HTML element.

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Explanation: The background-color property is used to set the background color of an element in CSS. It can take any valid color value, such as a named color, a hexadecimal value, or an RGB value.

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Explanation: The font-family property is used to set the font family of an element in CSS. It accepts font family names such as Arial, Times New Roman, etc.

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Explanation: The text-align property is used to align text within an element in CSS. It accepts values such as left, right, center, and justify.

Which property is used to create a border around an element in CSS?

a) border-color

b) border

c) border-style

d) border-width

Answer: b) border

Explanation: The border property is used to create a border around an element in CSS. It combines the border-width, border-style, and border-color properties.

Which property is used to set the height of an element in CSS?

a) height

b) width

c) size

d) length

Answer: a) height

Explanation: The height property is used to set the height of an element in CSS. It accepts values such as pixels, ems, rems, percentages, etc.

Which property is used to specify the position of an element in CSS?

a) place

b) location

c) position

d) placement

Answer: c) position

Explanation: The position property is used to specify the position of an element in CSS. It accepts values such as relative, absolute, fixed, and sticky.

Which property is used to add space between the content and the border of an element in CSS?

a) padding

b) margin

c) space

d) gutter

Answer: a) padding

Explanation: The padding property is used to add space between the content and the border of an element in CSS. It accepts values such as pixels, ems, rems, percentages, etc.

Which property is used to make text bold in CSS?

a) font-size

b) font-weight

c) font-style

d) font-variant

Answer: b) font-weight

Explanation: The font-weight property is used to make text bold in CSS. It accepts values such as normal, bold, bolder, and lighter.

Which property is used to control the visibility of an element in CSS?

a) display

b) visibility

c) opacity

d) hidden

Answer: b) visibility

Explanation: The visibility property is used to control the visibility of an element in CSS. It accepts values such as visible and hidden.

Which property is used to create an underline beneath text in CSS?

a) text-decoration

b) text-transform

c) text-shadow

d) text-underline

Answer: a) text-decoration

Explanation: The text-decoration property is used to create an underline beneath text in CSS. It can also be used to create other text decorations such as strikethrough, overline, and blink.

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Explanation: The background-color property sets the background color of an element in CSS.

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Explanation: The font-family property sets the font family for text in an element in CSS.

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Explanation: The text-align property sets the horizontal alignment of text in an element in CSS.

Which property is used to create a border around an element in CSS?

a) border-color

b) border

c) border-style

d) border-width

Answer: b) border

Explanation: The border property sets the border properties for an element in CSS, including the border color, border style, and border width.

Which property is used to set the height of an element in CSS?

a) height

b) width

c) size

d) length

Answer: a) height

Explanation: The height property sets the height of an element in CSS.

Which property is used to specify the position of an element in CSS?

a) place

b) location

c) position

d) placement

Answer: c) position

Explanation: The position property sets the position of an element in CSS.

Which property is used to add space between the content and the border of an element in CSS?

a) padding

b) margin

c) space

d) gutter

Answer: a) padding

Explanation: The padding property sets the padding (space) between the content and the border of an element in CSS.

Which property is used to make text bold in CSS?

a) font-size

b) font-weight

c) font-style

d) font-variant

Answer: b) font-weight

Explanation: The font-weight property sets the weight (boldness) of the font in an element in CSS.

Which property is used to control the visibility of an element in CSS?

a) display

b) visibility

c) opacity

d) hidden

Answer: b) visibility

Explanation: The visibility property sets the visibility of an element in CSS.

Which property is used to create an underline beneath text in CSS?

a) text-decoration

b) text-transform

c) text-shadow

d) text-underline

Answer: a) text-decoration

Explanation: The text-decoration property sets or removes text decorations such as underline, overline, and line-through in an element in CSS.

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Explanation: The background-color property sets the background color of an element in CSS.

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Explanation: The font-family property sets the font family for an element in CSS.

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Explanation: The text-align property is used to align text within an element in CSS.

Which property is used to create a border around an element in CSS?

a) border-color

b) border

c) border-style

d) border-width

Answer: b) border

Explanation: The border property is used to create a border around an element in CSS.

Which property is used to set the height of an element in CSS?

a) height

b) width

c) size

d) length

Answer: a) height

Explanation: The height property is used to set the height of an element in CSS.

Which property is used to specify the position of an element in CSS?

a) place

b) location

c) position

d) placement

Answer: c) position

Explanation: The position property is used to specify the position of an element in CSS.

Which property is used to add space between the content and the border of an element in CSS?

a) padding

b) margin

c) space

d) gutter

Answer: a) padding

Explanation: The padding property is used to add space between the content and the border of an element in CSS.

Which property is used to make text bold in CSS?

a) font-size

b) font-weight

c) font-style

d) font-variant

Answer: b) font-weight

Explanation: The font-weight property is used to make text bold in CSS.

Which property is used to control the visibility of an element in CSS?

a) display

b) visibility

c) opacity

d) hidden

Answer: b) visibility

Explanation: The visibility property is used to control the visibility of an element in CSS.

Which property is used to create an underline beneath text in CSS?

a) text-decoration

b) text-transform

c) text-shadow

d) text-underline

Answer: a) text-decoration

Explanation: The text-decoration property is used to create an underline beneath text in CSS.

Which property is used to set the background color of an element in CSS?

a) background-color

b) color

c) background

d) background-image

Answer: a) background-color

Explanation: The background-color property sets the background color of an element. It can take any valid CSS color value, such as a color name, RGB value, or hex code.

Which property is used to set the font family in CSS?

a) font-size

b) font-style

c) font-weight

d) font-family

Answer: d) font-family

Explanation: The font-family property sets the font family of an element. It can take a list of font family names or generic font family names.

Which property is used to align text within an element in CSS?

a) align-text

b) text-align

c) text-justify

d) text-indent

Answer: b) text-align

Explanation: The text-align property sets the horizontal alignment of text within an element. It can take values such as left, right, center, and justify.

Which property is used to create a border around an element in CSS?

a) border-color

b) border

c) border-style

d) border-width

Answer: b) border

Explanation: The border property is a shorthand property that sets the width, style, and color of an element’s border.