Are there any CSS properties that cannot be embedded?

When I say inline, I mean placing CSS properties in the style attribute.

Is there a way to determine with Javascript if a particular property cannot be included or not?

+3
source share
3 answers

All Css properties can be used,

but you cannot use pseudo-classes and pseudo-elements , for example :hover, :after :nth-child()etc.

+6
source

You can embed every style that you can define in a regular STYLE element or in an external style sheet (see section 14.2.2 of the HTML specification ).

, , . :

, [[CSS2]] , 4.1.8 ( ).

4.1.8 , , STYLE .

+1

I can’t come up with any (standard) CSS that cannot be written inline, but you cannot declare, for example, a class or a pseudo-class from a string.

Inline is the right place to define CSS, so any CSS will work there, otherwise CSS prevalence (C = cascading) will be violated.

0
source

All Articles