CSS MCQ Questions and answers PDF [120 Important MCQs]

CSS MCQ Questions and Answers PDF Download. Helpful for COPA, O level and all other types of Computer IT Competitive Exams. These are the Most important and repeated question.

CSS MCQ Questions and Answers PDF

1. How can we change the background color of an element?

a) background-color

b) color

c) Both A and B

d) None of these

Ans. a

2. Which is the correct CSS syntax?

a) body: color = black;

b) body {color; black}

c) {body: color : black;}

d) {body : color = black;}

Ans. b

3. How can we select an element with a specific ID in CSS?

a) #

b) .

c) !

d) None of these

Ans. a

4. How can we select an element with a specific Class in CSS?

a) #

b) .

c) !

d) None of these

Ans. b

5. Can negative values be allowed in padding property?

a) Yes

b) No

c) Depends on property

d) None of these

Ans. b

6. The CSS property used to specify the transparency of an element is?

a) opacity

b) visibility

c) filter

d) None of these

Ans. a

7. How can we specify the spacing between each letter in a text in CSS?

a) alpha-spacing        

b) letter-spacing

c) character-spacing  

d) None of these

Ans. b

8. We can make rounded borders around element using which CSS element?

a) border-collapse

b) border-round

c) border-radius

d) None of these

Ans. c

9. Which of the following property specifies the look and design of an outline?

a) outline-style

b) outline

c) outline-font

d) None of these

Ans. a

10. Which of the following are valid CSS position property values?

a) static

b) relative

c) fixed

d)All of these

Ans. d

11. Which of the following CSS property is used to controlling the layout?

a) display

b) color

c) text

d) None of these

Ans. a

12. Which of the following CSS property specifies the origin of the background image?

a) background-origin

b) background-size

c) origin

d) None of these

Ans. a

13. How are custom fonts defined using CSS?

a) @font-face rule     

b) Custom fonts cannot be defined

c) src tags                   

d) None of these

Ans. a

14. Which of the following are parts of the CSS box model?

a) Margins     

b) Borders      

c) Padding      

d) All of these

Ans. d

15. Which of the following components of the CSS box model are transparent?

a) Padding

b) Margin

c) Both A and B

d) Content

Ans. c

16. Which of the following can be achieved with CSS lists?

a) Set different list item markers for ordered lists

b) Set different list item markers for unordered lists

c) Set an image as the list item marker

d) All of these

Ans. d

17. Which of the following CSS property specifies the type of list item marker?

a) list

b) list-style-type

c) ul

d) ol

Ans. b

18. What value should be passed to the width parameter if we want an element,say a table, to span the entire width of the screen?

a) 100%

b) 50%

c) 0%

d) None of these

Ans. a

19. Which of the following properties is used to align text in CSS?

a) text-align

b) text-alignment

c) text

d) text-position

Ans. a

20. Which of the following is the correct approach to make a table responsive?

a) overflow-x: auto    

b) overflow-x: none

c) Both A and B          

d) None of these

Ans. a

21. Which of the following CSS properties specifies the stack order of elements?

a) z-index       

b) overlap       

c) No such specific properties is present       

d) None of these

Ans. a

22. What are the uses of CSS pseudo-elements?

a) Style specified parts of an element

b) Style the first letter or line of an element

c) Insert content before or after the element

d) All of the above

Ans. d

23. How can we select elements with a specified attribute in CSS?

a) [attribute] selector

b) [property] selector

c) Both A and B

d) None of these

Ans. a

24. Which of the following are types of length units in CSS?

a) Absolute

b) Relative

c) Both A and B

d) None of these

Ans. c

25. What parameter does the calc() function in CSS take?

a) A sentence

b) A mathematical expression

c) A number

d) None of these

Ans. b

26. How can we add more importance to a property/value than normal?

a) !important

b) important

c) bold

d) None of these

Ans. a

27. Which CSS property specifies the painting area of the background?

a) background-size                 

b) background-clip

c) background-image             

d) None of these

Ans. b

28. What are the different types of gradients in CSS?

a) Linear Gradients    

b) Conic Gradients     

c) Radial Gradients    

d) All of these

Ans. d

29. Which CSS property is used to create an image reflection?

a) box-reflect

b) image-reflect

c) reflect-img

d) None of these

Ans. a

30. The transparent keyword is equivalent to which RGBA() value in CSS?

a) RGBA(0, 0, 0, 1)

b) RGBA(255, 255, 255, 1)

c) RGBA(0, 0, 0, 0)

d) RGBA(255, 255, 255, 0)

Ans. c

31. What function is used to insert values of a CSS variable?

a) var()

b) rand()

c) varchar()

d) calc()

Ans. a

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

a) var(–name, value)

b) var(–name)

c) var(value)

d) None of these

Ans. a

33. The CSS property used to control the element’s font size is –

a) text-style

b) text-size

c) font-size

d) None of these

Ans. c

34. The HTML attribute used to define the internal stylesheet is –

a) <style>       

b) style

c) <link>         

d) <script>

Ans. a

35. Which of the following is the correct syntax to make the background-color of all paragraph elements to yellow?

a) p {background-color : yellow;}      

b) p {background-color : #yellow;}

c) all {background-color : yellow;}     

d) all p {background-color : #yellow;}

Ans. a

36. Which of the following is the correct syntax to display the hyperlinks without any under line?

a) a {text-decoration : underline;}

b) a {decoration : no-underline;}

c) a {text-decoration : none;}

d) None of these

Ans. c

37. What is CSS?

a) CSS is a style sheet language

b) CSS is designed to separate the presentation and content, including layout, colors, and fonts

c) CSS is the language used to style the HTML documents

d) All of the mentioned

Ans. d

38. Which of the following tag is used to embed css in html page?

a) <css>

b) <!DOCTYPE html>

c) <script>

d) <style>

Ans. d

39. Which of the following CSS selectors are used to specify a group of elements?

a) tag

b) id

c) class

d) both class and tag

Ans. c

40. Which of the following has introduced text, list, box, margin, border, color, and background properties?

a) HTML

b) PHP

c) CSS

d) Ajax

Ans. c

CSS MCQ Questions and Answers PDF Download [120 MCQs]
HTML MCQ PDF [Top 40 Questions] Crack Every Exam
HTML MCQ Questions and Answers PDF [230 MCQs for all exams]
Computer GK [10000 MCQ PDF] Questions for Competitive Exams
Java MCQ Questions and answers [PDF] 700 MCQs
Python MCQ Questions and Answers PDF [395 MCQs]
WhatsApp Channel Join Now
Telegram Channel Join Now
Instagram Page Join Now