MCQ on Introduction to CSS – Test your knowledge with these multiple-choice questions covering the fundamentals of CSS, including selectors, properties, and styling techniques. Perfect for reviewing your understanding of CSS basics!”
What is the primary purpose of CSS in web development?
- A) To structure web content
- B) To enhance the visual presentation of web pages
- C) To define interactive elements
- D) To handle server-side operations
Answer: B) To enhance the visual presentation of web pages
Which type of CSS is primarily used when styling multiple web pages with consistent design?
- A) External CSS
- B) Internal CSS
- C) Inline CSS
- D) Embedded CSS
Answer: A) External CSS
What property in CSS is used to change the color of text?
- A) text-color
- B) font-color
- C) color
- D) text-style
Answer: C) color
Which property can be used to set the spacing between letters in text?
- A) letter-spacing
- B) word-spacing
- C) text-spacing
- D) character-spacing
Answer: A) letter-spacing
What property is used to set the alignment of text within an HTML element?
- A) text-align
- B) align-text
- C) text-justify
- D) align-content
Answer: A) text-align
Which property is used to specify the space between two lines of text?
- A) line-spacing
- B) text-spacing
- C) line-height
- D) text-height
Answer: C) line-height
How can you add a background image to a webpage using CSS?
- A) Using the background-image property
- B) Using the image-background property
- C) Using the background property
- D) Using the image property
Answer: A) Using the background-image property
What property is used to set the width of an image border?
- A) border-size
- B) image-border-width
- C) border-width
- D) image-width
Answer: C) border-width
Which CSS property is used to control the transparency of an image?
- A) transparency
- B) opacity
- C) visibility
- D) clear
Answer: B) opacity
What is the primary advantage of using External CSS over Inline CSS?
- A) Faster loading time
- B) Easier maintenance
- C) Greater specificity
- D) Simpler implementation
Answer: B) Easier maintenance
Which CSS property can be used to specify the style of a border?
- A) border-style
- B) border-design
- C) border-type
- D) border-format
Answer: A) border-style
What does the line-height property in CSS determine?
- A) The thickness of a border
- B) The space between two letters
- C) The space between two lines of text
- D) The size of the font
Answer: C) The space between two lines of text
How can you align text within a table cell vertically?
- A) Using the text-align property
- B) Using the align-property
- C) Using the vertical-align property
- D) Using the align-text property
Answer: C) Using the vertical-align property
Which CSS property is used to collapse table borders into a single border?
- A) border-collapse
- B) table-border
- C) border-combine
- D) border-merge
Answer: A) border-collapse
Which property is used to set the width of a border in CSS?
- A) border-size
- B) border-width
- C) border-thickness
- D) border-length
Answer: B) border-width
How can you add a background color to a webpage using CSS?
- A) Using the background-color property
- B) Using the color property
- C) Using the background property
- D) Using the page-color property
Answer: A) Using the background-color property
Which CSS property is used to define the font family of text?
- A) font-family
- B) text-family
- C) font-style
- D) text-font
Answer: A) font-family
What does the opacity property in CSS determine?
- A) The clarity of text
- B) The size of an element
- C) The transparency of an element
- D) The color saturation of an element
Answer: C) The transparency of an element
Which type of CSS is written within the HTML file itself?
- A) External CSS
- B) Internal CSS
- C) Inline CSS
- D) Embedded CSS
Answer: B) Internal CSS
What does the letter-spacing property in CSS determine?
- A) The space between two words
- B) The space between two lines of text
- C) The space between two letters
- D) The size of the font
Answer: C) The space between two letters
