Quiz on CSS Style Sheet

1) Which attribute is used to include an external CSS file in HTML?

a) <link>

b) <style>

c) <css>

d) <external>

Answer: a) <link>

2) What does CSS stand for?

a) Creative Style Sheets

b) Computer Style Sheets

c) Cascading Style Sheets

d) Colorful Style Sheets

Answer: c) Cascading Style Sheets

3) Which CSS property is used to change the text color?

a) font-color

b) text-color

c) color

d) font-style

Answer: c) color

4) How can you set a background image in CSS?

a) background-img: url('image.jpg');

b) bg-image: url('image.jpg');

c) background-image: url('image.jpg');

d) img-background: url('image.jpg');

Answer: c) background-image: url('image.jpg');

5) Which CSS property is used to control the space between lines of text?

a) text-spacing

b) line-height

c) letter-spacing

d) text-line

Answer: b) line-height

6) What does the "float" property in CSS do?

a) Aligns text to the left or right within its container

b) Increases the size of an element

c) Adds a shadow to an element

d) Centers the element horizontally

Answer: a) Aligns text to the left or right within its container

7) Which CSS property is used for controlling the size of an element's border?

a) border-width

b) border-style

c) border-size

d) border-length

Answer: a) border-width

8) Which property is used to change the font of an element?

a) text-font

b) font-style

c) font-family

d) text-family

Answer: c) font-family

9) What does the CSS property "opacity" control?

a) Element's visibility

b) Element's size

c) Element's color

d) Element's transparency

Answer: d) Element's transparency

10) Which CSS display property value makes an element take up the full width of its container?

a) inline

b) block

c) inline-block

d) flex

Answer: b) block

11) What does the "z-index" property in CSS control?

a) Element's transparency

b) Element's size

c) Element's stacking order

d) Element's rotation

Answer: c) Element's stacking order

12) Which CSS property is used to specify the space between cells in a table?

a) cell-spacing

b) table-spacing

c) spacing

d) border-spacing

Answer: d) border-spacing

13) What is the default value of the "position" property in CSS?

a) static

b) relative

c) absolute

d) fixed

Answer: a) static

14) Which CSS property is used to add rounded corners to an element?

a) border-curve

b) corner-radius

c) border-radius

d) round-border

Answer: c) border-radius

15) Which CSS property is used to change the spacing between letters in text?

a) letter-spacing

b) word-spacing

c) text-spacing

d) line-spacing

Answer: a) letter-spacing

Explore Categories

JAVA

PYTHON

JAVASCRIPT

PHP

REACT

CSS

C & C++

BOOTSTRAP

HOMEPAGE