CSS MCQs Questions Answers

59
Score: 0
Attempted: 0/59
1. Which CSS pseudo-class is used to style an input field that is required but not filled out?



2. Which pseudo-class targets input elements that are optional?



3. Which CSS property changes the style of placeholder text inside form fields?



4. Which CSS property changes the cursor when hovering over form elements?



5. Which CSS property controls the spacing inside input fields?



6. Which CSS property allows you to create a counter that increments automatically?



7. Which CSS property resets a counter to a specific value?



8. Which CSS property inserts content before or after an element, often used with counters?



9. Which of the following is an absolute CSS unit?



10. Which of the following is a relative CSS unit?



11. Which CSS unit is relative to the font size of the root element?



12. Which CSS unit represents a percentage of the parent element’s width?



13. Which CSS property is inherited by default by child elements?



14. Which CSS property is not inherited by default?



15. Which keyword forces a property to inherit the value from its parent?



16. Which keyword resets a property to its default initial value?



17. Which CSS concept determines which style is applied when multiple rules match the same element?



18. Which of the following has the highest specificity?



19. Between a class selector and an ID selector, which has higher specificity?



20. How is specificity calculated for inline styles?



21. What does the !important rule do in CSS?



22. Which of the following is a valid CSS math function?



23. Which CSS function allows combining percentages and pixels in one property?



24. Which CSS math function chooses the smallest value from multiple values?



25. Which CSS math function chooses the largest value from multiple values?



26. Which CSS math function clamps a value between a minimum and maximum?



27. Which of the following is a recommended method for CSS optimization?



28. Which tool can help identify unused CSS rules?



29. Why is CSS accessibility important?



30. Which CSS property improves accessibility for screen readers?



31. Which CSS property can be used to create a flexible website layout?



32. Which CSS layout method allows placing items in rows and columns?



33. Which CSS property defines the spacing between grid items?



34. Which layout method is best for one-dimensional layouts?



35. Which CSS property helps create a sticky navigation bar?



36. Which CSS property allows elements to wrap to the next line in a flex container?



37. Which CSS property defines the minimum width an element can shrink to?



38. Which CSS property defines the maximum width an element can expand to?



39. Which property is used in responsive web design to make layouts adjust automatically?



40. Which CSS property is used to create smooth changes in property values over time?



41. Which property specifies the duration of a CSS transition?



42. Which CSS property allows a delay before a transition starts?



43. Which CSS at-rule defines keyframes for animations?



44. Which CSS property sets the name of an animation to use with @keyframes?



45. Which CSS property controls how many times an animation should play?



46. Which CSS filter applies a blur effect to an element?



47. Which CSS filter converts an element to grayscale?



48. Which CSS filter adjusts the brightness of an element?



49. Which CSS gradient creates a smooth transition from one color to another along a straight line?



50. Which CSS gradient radiates from a central point outward in a circular shape?



51. Which CSS gradient is rotated around a center point like a pie chart?



52. Which CSS function repeats a gradient pattern?



53. Which CSS rule is used to apply styles for specific screen sizes or devices?



54. Which media query keyword applies styles when the screen width is less than 768px?



55. Which media query keyword applies styles when the screen width is greater than or equal to 1024px?



56. Which media feature targets high-resolution (retina) screens?



57. Which media query ensures styles apply only for print output?



58. Which property is commonly combined with media queries to create responsive typography?



59. Which unit is recommended for responsive typography in media queries?



Contents Copyrights Reserved By T4Tutorials