Does anyone know what is the maximum length I can enter for the html title attribute and whether special characters are allowed?
-
1http://stackoverflow.com/questions/1496096/is-there-a-limit-to-the-length-of-html-attributes – Mustafa Genç Aug 27 '12 at 10:07
-
Possbile duplicate http://stackoverflow.com/questions/8516235/max-length-of-title-attribute – mas_oz2k1 Mar 26 '13 at 23:15
-
2Possible duplicate of [Max length of Title Attribute](https://stackoverflow.com/questions/8516235/max-length-of-title-attribute) – Luke Girvin Jun 07 '17 at 14:27
4 Answers
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.
-
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. – Jukka K. Korpela Aug 27 '12 at 12:04
-
@blasteralfred, your link refers to rendering of `title` *elements*. A different question, though partly similar caveats apply. It is not a matter of character code but about using characters not present in the font that will be used. – Jukka K. Korpela Aug 27 '12 at 12:06
Practically there is no limit to the length. However beyond certain characters, your browser wont show the whole title. Special characters are allowed.

- 622
- 4
- 17
There is no limit in the specifications.
But when you go past 64 characters, browsers will treat it differently
Internet Explorer breaks the text to two or more lines
whereas other browsers do not.

- 12,492
- 6
- 40
- 53