开发者

Displaying Alt + Number codes on HTML

I开发者_C百科 would like to write the character "▼" (Alt + 31) on HTML but it always shows me question mark.

What do I need to do in order to make my browser display it correctly ?

Thanks!


It's probably an encoding problem. Your file is saved with a certain character encoding, but your browser displays it with another encoding — either because you didn't specify a charset in the header, or a different charset from the files charset.

One solution is to edit and save your files using UTF-8, and also add UTF-8 to the charset:

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

What's probably better though, is to use HTML entities. Example: &copy; becomes ©. You still need to specify the charset though, but this way you don't have to worry about saving your file the wrong way and losing all the special characters.

There are many lists (random example) with all the available characters and their entities. However, not all characters have their own entity. For those you'll need to use their Unicode code. In this case you're looking for a "Black down-pointing triangle" which is &#x25BC; and becomes ▼.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜