dbj44
dbj44

Reputation: 1998

Can I use CSS pseudo elements to wrap some text in brackets?

Can I use CSS pseudo elements ::before and ::after to wrap some text in brackets?

i.e.

Text

becomes:

(Text)

Upvotes: 17

Views: 5671

Answers (1)

Christopher Marshall
Christopher Marshall

Reputation: 10736

Yes you can

http://jsfiddle.net/GHL6u/

<span>text</span>

span:before {
    content: '(';
}

span:after {
    content: ')';
}

Upvotes: 20

Related Questions