html - html 标题的最大长度

标签 html

有谁知道我可以为 html title 属性输入的最大长度是多少以及是否允许使用特殊字符?

最佳答案

根据当前的 HTML 4 和 5 规范,标题长度没有限制;但 IE 浏览器对 HTML 4.01 的限制为 512 个字符.

其他浏览器有长标题的问题(每次都要自己测试)。此外,您几乎可以在标题中使用任何内容,包括字母、数字、特殊字符(符号)等。但要避免使用 Unicode。

Unicode 标题会带来一些麻烦。请参阅此 Stack Overflow 帖子 Unicode HTML titles displaying as boxes in IE, Chrome .

来自@Jukka K. Korpela 的评论:

The reason to avoid anything except the most common characters is that title attribute values are rendered, on mouseover, by browser routines that typically use a specific font, with limited character repertoire. There is no formal prohibition, just lousy implementations.

关于html - html 标题的最大长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12139904/

相关文章:

html - @font-face 黑名单字体

html - css如何让图像比屏幕大?

jquery - 自动缩放输入 [type=text] 到值的宽度?

javascript - 如何限制幻灯片的大小 (JS)

javascript - jQuery:slideDown 和淡入淡出,立即失去高度

html - 使用 CSS 转换时可选择的一半 div

javascript - 如何用css展开一个div

javascript - 如何修改WebRTC MediaStream视频轨道的内容?

html - 如何保持水平放置的输入字段始终对齐?

html - 如何在 HTA 文件中使用 VBScript 单击按钮