CSS Questions

Warm up for CSS questions with most asked questions and answers for junior, mid, and senior roles.

Senior

What is graceful degradation?

Show 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.

Senior

What is progressive enhancement?

Show 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.

Senior

What is Pseudo-elements ?

Show Answer

A CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected elements.

Senior

What are the benefits of CSS sprites?

Show Answer

The benefits of using CSS sprites are:

  • Reduces the number of http requests
  • Improves SEO
  • Reduces overall image size
    Senior

    Explain CSS specificity.

    Show 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.