Possible Duplicate:
Adding HTML entities using CSS content
I have the following setup
CSS:
.header:before {
content: "«";
}
.header:after {
content: "»";
}
HTML:
<h3 class="header">Hello, this is some text which should be wrapped.</h3>
I'd simply like whatever is written in header to be wrapped in « («
) and » (»
). How can I make this work in the CSS? It's currently appearing as:
« Hello, this is some text which should be wrapped. »
rather than:
« Hello, this is some text which should be wrapped. »
The general format for a Unicode character inside a string is \000000 to \FFFFFF – a backslash followed by six hexadecimal digits. You can leave out leading 0 digits when the Unicode character is the last character in the string or when you add a space after the Unicode character.
CSS doesn't use HTML's entities; it uses its own unicode escape sequences. You need to use \00a9 for the copyright symbol.
CSS can insert text content before or after an element.
You can't use HTML entities in CSS, but you can use Unicode hex escapes, such as
span.url:before { content: "\27e8" }
span.url:after { content: "\27e9" }
(from one of my own stylesheets -- look up the hex codepoints for the exact characters you want yourself). Notice that unlike in some other notations, hex digits follow the backslash directly, with no intervening u
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With