Evanss
Evanss

Reputation: 23563

Is CSS generated content only for text?

Is CSS generated content only for text? For instance the code below shows the span as text, it doesnt create a new span.

.addbefore:before {
    content: "<span>dfsd</span>";
}

Upvotes: 1

Views: 49

Answers (1)

zzzzBov
zzzzBov

Reputation: 179046

Is CSS generated content only for text?

Yes.

pseudo-elements do not create new DOM elements within themselves, but they are treated as if they were new DOM elements within the element whose selector they match.

Upvotes: 2

Related Questions