CSS Basics- Practice Quiz

11. What is CSS?

  • A programming language used for server-side scripting.
  • A markup language used for creating web pages.
  • To describe the look and formatting of a document written in HTML.
  • A database management system used for storing and retrieving data.

12. What is the syntax of CSS?

  • Scripted language with complex syntax rules.
  • Cascading Style Sheets with rules written in plain English.
  • Cascading Style Sheets with rules written in a selector followed by a declaration block.
  • Cascading Style Sheets with rules written in a declaration block followed by a selector.

13. What is the purpose of CSS in web development?

  • To define the structure and layout of a web page.
  • To store and retrieve data from a database.
  • To describe the look and formatting of a document written in HTML.
  • To define the behavior and functionality of a web page.

CSS Pseudo class selectors- Practice Quiz

14. Which of the following is a pseudo-class selector in CSS?

  • ::before
  • #id
  • .class
  • element

15. Which of the following is a pseudo-element selector in CSS?

  • :hover
  • :before
  • [attribute=value]
  • + selector

16. What is the purpose of attribute selectors in CSS?

  • To select elements based on their class names.
  • To select elements based on their IDs.
  • To select elements based on their tag names.
  • To select elements based on their attribute values.

17. Which CSS property is used to define the font style, weight, size, and family of text in an element?

  • display
  • position
  • font
  • float

18. Which CSS property is used to control the position of an element on a web page?

  • max-width
  • margin
  • float
  • position

CSS Design- Practice Quiz

19. What is the purpose of the "name" attribute in an HTML form input element?

  • To specify the label for the input field.
  • To define the type of input field.
  • To provide a unique identifier for the input field.
  • To set a default value for the input field.

20. What CSS property is used to set the background color of an element?

  • text-color
  • background-color
  • border-color
  • color

21. What CSS property is used to specify how an element's box should be sized, including padding and border?

  • padding
  • box-sizing
  • margin
  • border-width

22. What CSS property is used to set the style of an element's text, such as bold, italic, or underline?

  • text-decoration
  • font-size
  • font-style
  • font-weight

Leave a Reply