5

I often see this:

<head>
<meta charset="utf-8">
<title>Title</title>
...
</head>

Is it important to put the chartset definition BEFORE the the title tag?

Thanks!

Yves M.
  • 28,433
  • 22
  • 100
  • 135
WeekendCoder
  • 791
  • 3
  • 10
  • 15
  • possible duplicate of [In , which comes first: or ?](http://stackoverflow.com/questions/5572471/in-head-which-comes-first-meta-or-title) – Nick Bartlett Jun 06 '15 at 12:10

1 Answers1

8

yes it is, see https://code.google.com/p/doctype-mirror/wiki/MetaCharsetAttribute

In order for all browsers to recognize a <meta charset> declaration, it must be

  • Within the <head> element,
  • Before any elements that contain text, such as the <title> element, AND
  • Within the first 512 bytes of your document, including DOCTYPE and whitespace
connexo
  • 49,059
  • 13
  • 74
  • 108
mnagel
  • 6,189
  • 4
  • 28
  • 63