Question

Is it possible to add pseudo element declaration inline. For eg. can I do the following inline ?

.XYZ:after {
content: '';
width: 100%;
display: inline-block;}

<div class="XYZ"></div> /*Pseudo element should be declarer inline*/
Was it helpful?

Solution

No, it is not possible to apply pseudo selectors via inline CSS, that's only possible from within <style></style> blocks or external stylesheet file.

Imagine constructing an email template with inline pseudo selector that uses content property, bad guys could have done the harm I suppose. So it is not possible.

OTHER TIPS

No. pseudo element stylings may only be declared in an external stylesheet or inside <style></style> tags.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top