VOOZH about

URL: https://www.geeksforgeeks.org/css/css-scope-pseudo-class/

⇱ CSS :scope pseudo-class - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

CSS :scope pseudo-class

Last Updated : 30 Aug, 2022

A scope element forms a context for a block of styles. That element provides a reference point for selectors to be matched against. A scope element is defined using the scoped attribute. Styles declared with scoped attributes will be applied to all elements inside its parent element.

Syntax:

:scope

Example 1:

Output:

👁 Image

Example 2:

Output:

👁 Image

Browser Support:

  • Google Chrome 27+
  • Edge 79+
  • Firefox 32+
  • Opera 15+
  • Safari 7+
Comment
Article Tags: