CSS Questions
Warm up for CSS questions with most asked questions and answers for junior, mid, and senior roles.
What is graceful degradation?
Show AnswerHide Answer
Graceful degradation is a design philosophy that centers around trying to build a modern web site/application that will work in the newest browsers, but falls back to an experience that while not as good still delivers essential content and functionality in older browsers.
What is progressive enhancement?
Show AnswerHide Answer
Progressive enhancement is a design philosophy that provides a baseline of essential content and functionality to as many users as possible, while delivering the best possible experience only to users of the most modern browsers that can run all the required code.
What is Pseudo-elements ?
Show AnswerHide Answer
A CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected elements.
What are the benefits of CSS sprites?
Show AnswerHide Answer
The benefits of using CSS sprites are:
- Reduces the number of http requests
- Improves SEO
- Reduces overall image size
Explain CSS specificity.
Show AnswerHide Answer
Specificity is the means by which browsers decide which CSS property values are the most relevant to an element and, therefore, will be applied. Simply put, if two CSS selectors apply to the same element, the one with higher specificity is used.