Pluto
Pluto

Reputation: 333

Special Characters ">" not displaying by using UTF-8

Here are my codes below:

    ul.pathnav a:before{
    content:"\0X3E";
    text-decoration:none;
      }

\0x3e is the hex for ">", but it doesn't work. I tried another special character, it works just fine. For example: in downwards filled triangle, which hex code is \25BC.

Not quite sure what should I add. In the header the code is:

    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

Upvotes: 2

Views: 576

Answers (3)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201866

The character escape syntax in CSS uses just the backslash \ followed by hexadecimal digits and possibly a whitespace character. An X is neither needed nor allowed here. So a proper syntax using an escape would be

content: "\3E";

On the other hand, there is no need to escape the GREATER THAN character > in a CSS string, so you can write just

content: ">";

Upvotes: 3

Arbel
Arbel

Reputation: 30999

Use \3E instead of \0X3E

Demo: http://jsfiddle.net/nDc3K/

p:before {
    content:"\3E";
    text-decoration:none;
}

/\

<p>Test</p>

Upvotes: 1

Aaron K
Aaron K

Reputation: 437

content:"\0X3E";

should be written as

content:"\03e";

http://www.fileformat.info/info/unicode/char/3e/index.htm

page for ">" character

Upvotes: 1

Related Questions