html标题的最大长度 [英] Maximum length of a html title

查看:88
本文介绍了html标题的最大长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道什么是我可以输入html标题属性的最大长度以及是否允许使用特殊字符吗? 解决方案

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



其他浏览器在长标题时遇到问题(每次都必须自行测试)。你也可以在标题中使用几乎任何东西,包括字母,数字,特殊字符(符号)等。但避免使用Unicode。



Unicode标题会带来一些麻烦。请参阅此堆栈溢出文章 Unicode HTML标题在IE中显示为框,Chrome



来自@Jukka K. Korpela的评论:


避免除最常见字符之外的任何内容的原因是,标题属性值在鼠标悬停时由浏览器例程呈现,浏览器例程通常使用特定的字体,且字符集有限。没有正式的禁止,只是糟糕的实现。



Does anyone know what is the maximum length I can enter for the html title attribute and whether special characters are allowed?

解决方案

There is no limit for title length based on the current HTML 4 and 5 specs; but IE explorer has a limit of 512 characters for HTML 4.01.

Other browsers have trouble with long titles (you have to test it yourself each time). Also you may use almost anything, including alphabets, numbers, special chars (symbols) etc. in your title. But avoid Unicode.

Unicode titles creates some trouble. Refer to this Stack Overflow post Unicode HTML titles displaying as boxes in IE, Chrome.

From a comment by @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标题的最大长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆