010011100101
010011100101

Reputation: 1710

What is this CSS selector? Is it valid? (html.js.cssanimations.csstransforms)

I was messing around in the Developer Tools inside Firefox and right-clicked an element and copied the css path. This was at the beginning of the path before body:

html.js.cssanimations.csstransforms body...

I tried it out in Firefox and Chrome and it seems to be a valid selector, I'm just curious because I never seen it before.

Is this an actual CSS selector that can be used in all browsers?

I'm interested in it because I was thinking I can use it to override some selectors due to it having a higher specificity in a user defined custom CSS sheet.

Any info would be appreciated, thanks.

Upvotes: 1

Views: 50

Answers (2)

BetaGo
BetaGo

Reputation: 36

it's a valid CSS selector; when you set classes in html tag like

<html class="js cssanimations csstransforms">;

this selector will match body tag in html.

Upvotes: 0

ray
ray

Reputation: 27275

It’s the body under an html tag with a series of classes:

<html class=“js cssanimations csstransforms”>
  <body>
    ...

Some js libraries test for browser feature availability and add css classes to the root so that different styles and/or behavior can be applied depending on feature availability.

Upvotes: 2

Related Questions