3

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

halfer
  • 19,824
  • 17
  • 99
  • 186
user1503699
  • 55
  • 1
  • 3
  • 8

4 Answers4

2

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Alfred
  • 21,058
  • 61
  • 167
  • 249
  • 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
0

Practically there is no limit to the length. However beyond certain characters, your browser wont show the whole title. Special characters are allowed.

Huston Lopes
  • 622
  • 4
  • 17
0

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.

amitchhajer
  • 12,492
  • 6
  • 40
  • 53
0

Why make a title very long? Short and concise does the trick.

Ed Heal
  • 59,252
  • 17
  • 87
  • 127