How do you use the CSS content
property to add html entities?
Using something like this just prints
to the screen instead of the non-breaking space:
.breadcrumbs a:before {
content: ' ';
}
How do you use the CSS content
property to add html entities?
Using something like this just prints
to the screen instead of the non-breaking space:
.breadcrumbs a:before {
content: ' ';
}
There is a way to paste an
nbsp
- open CharMap and copy character 160. However, in this case I'd probably space it out with padding, like this:You might need to set the breadcrumbs
display:inline-block
or something, though.CSS is not HTML.
is a named character reference in HTML; equivalent to the decimal numeric character reference 
. 160 is the decimal code point of theNO-BREAK SPACE
character in Unicode (or UCS-2; see the HTML 4.01 Specification). The hexadecimal representation of that code point is U+00A0 (160 = 10 × 161 + 0 × 160). You will find that in the Unicode Code Charts and Character Database.In CSS you need to use a Unicode escape sequence for such characters, which is based on the hexadecimal value of the code point of a character. So you need to write
This works as long as the escape sequence comes last in a string value. If characters follow, there are two ways to avoid misinterpretation:
a) (mentioned by others) Use exactly six hexadecimal digits for the escape sequence:
b) Add one white-space (e. g., space) character after the escape sequence:
(Since
f
is a hexadecimal digit,\a0f
would otherwise meanGURMUKHI LETTER EE
here, or ਏ if you have a suitable font.)The delimiting white-space will be ignored, and this will be displayed
foo
, where the displayed space here would be aNO-BREAK SPACE
character.The white-space approach (
'\a0 foo'
) has the following advantages over the six-digit approach ('\0000a0foo'
):Thus, to display a space after an escaped character, use two spaces in the stylesheet –
– or make it explicit:
See CSS 2.1, section "4.1.3 Characters and case" for details.
You have to use the escaped unicode :
Like
More info on : http://www.evotech.net/blog/2007/04/named-html-entities-in-numeric-order/
Use the hex code for a non-breaking space. Something like this:
In CSS you need to use a Unicode escape sequence in place of HTML Entities. This is based on the hexadecimal value of a character.
I found that the easiest way to convert symbol to their hexadecimal equivalent is, such as from ▾ (
▾
) to\25BE
is to use the Microsoft calculator =)Yes. Enable programmers mode, turn on the decimal system, enter
9662
, then switch to hex and you'll get25BE
. Then just add a backslash\
to the beginning.For Example :
http://character-code.com/arrows-html-codes.php
Example: If you want select your character , I selected "↬" "↬" (We use HEX values)
Result : ↬
Thats it :)