0% found this document useful (0 votes)
53 views61 pages

100 CSS Questions

The document contains a series of questions and answers designed to test knowledge of CSS properties. It covers various properties such as background color, font family, text alignment, borders, height, positioning, padding, font weight, visibility, and text decoration. Each question is followed by the correct answer and a brief explanation of the property in question.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views61 pages

100 CSS Questions

The document contains a series of questions and answers designed to test knowledge of CSS properties. It covers various properties such as background color, font family, text alignment, borders, height, positioning, padding, font weight, visibility, and text decoration. Each question is followed by the correct answer and a brief explanation of the property in question.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

1

100+ CSS Questions test your


skills and knowledge on 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 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?

Laurence Svekis [Link]


2

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

Laurence Svekis [Link]


3

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?

Laurence Svekis [Link]


4

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 background


color of an element in CSS?
a) background-color
b) color
c) background
d) background-image

Answer: a) background-color

Laurence Svekis [Link]


5

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

Laurence Svekis [Link]


6

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

Laurence Svekis [Link]


7

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.

Laurence Svekis [Link]


8

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

Laurence Svekis [Link]


9

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

Laurence Svekis [Link]


10

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.

Laurence Svekis [Link]


11

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

Laurence Svekis [Link]


12

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

Laurence Svekis [Link]


13

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

Laurence Svekis [Link]


14

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

Laurence Svekis [Link]


15

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

Laurence Svekis [Link]


16

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

Laurence Svekis [Link]


17

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

Laurence Svekis [Link]


18

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.

Laurence Svekis [Link]


19

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

Laurence Svekis [Link]


20

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

Laurence Svekis [Link]


21

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

Laurence Svekis [Link]


22

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

Laurence Svekis [Link]


23

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.

Laurence Svekis [Link]


24

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.

Laurence Svekis [Link]


25

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.

Laurence Svekis [Link]


26

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

Laurence Svekis [Link]


27

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

Laurence Svekis [Link]


28

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

Laurence Svekis [Link]


29

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.

Laurence Svekis [Link]


30

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

Laurence Svekis [Link]


31

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.

Laurence Svekis [Link]


32

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.

Laurence Svekis [Link]


33

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

Laurence Svekis [Link]


34

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

Laurence Svekis [Link]


35

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.

Laurence Svekis [Link]


36

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

Laurence Svekis [Link]


37

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

Laurence Svekis [Link]


38

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.

Laurence Svekis [Link]


39

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

Laurence Svekis [Link]


40

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

Laurence Svekis [Link]


41

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.

Laurence Svekis [Link]


42

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

Laurence Svekis [Link]


43

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

Laurence Svekis [Link]


44

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.

Laurence Svekis [Link]


45

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

Laurence Svekis [Link]


46

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

Laurence Svekis [Link]


47

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.

Laurence Svekis [Link]


48

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.

Laurence Svekis [Link]


49

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

Laurence Svekis [Link]


50

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

Laurence Svekis [Link]


51

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

Laurence Svekis [Link]


52

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.

Laurence Svekis [Link]


53

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.

Laurence Svekis [Link]


54

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.

Laurence Svekis [Link]


55

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.

Laurence Svekis [Link]


56

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.

Laurence Svekis [Link]


57

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.

Laurence Svekis [Link]


58

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

Laurence Svekis [Link]


59

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

Laurence Svekis [Link]


60

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

Laurence Svekis [Link]


61

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.

Laurence Svekis [Link]

You might also like