What's the HTML character entity for the # sig

2019-03-22 09:53发布

What's the HTML character entity for the # sign? I've looked around for "pound" (keeps returning the currency), and "hash" and "number", but what I try doesn't seem to turn into the right character.

7条回答
聊天终结者
2楼-- · 2019-03-22 10:36

You can search it on the individual character at fileformat.info. Enter # as search string and the 1st hit will lead you to U+0023. Scroll a bit down to the 2nd table, Encodings, you'll see under each the following entries:

HTML Entity (decimal)  #
HTML Entity (hex)      #
查看更多
成全新的幸福
3楼-- · 2019-03-22 10:37

The numerical reference is #.

查看更多
女痞
4楼-- · 2019-03-22 10:39

For # we have #.

Bear in mind, though, it is a new entity (IE9 can't recognize it, for instance). For wide support, you'll have to resort, as said by others, the numerical references # and, in hex, &#x23.

If you need to find out others, there are some very useful tools around.

查看更多
兄弟一词,经得起流年.
5楼-- · 2019-03-22 10:39

There is no HTML character entity for the # character, as the character has no special meaning in HTML.

You have to use a character code entity like # if you wish to HTML encode it for some reason.

查看更多
乱世女痞
6楼-- · 2019-03-22 10:40
# or #

http://www.asciitable.com/ has information. Wikipedia also has pages for most unicode characters.

http://en.wikipedia.org/wiki/Number_sign

查看更多
我想做一个坏孩纸
7楼-- · 2019-03-22 10:46

# is the best option because it is the only one that doesn't include the # (hash) in it. Supported by old browsers or not, it is the best practice going forward.

(What is the point of encoding something using the same symbol you are encoding?)

查看更多
登录 后发表回答