7

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.
  • 29,855
  • 23
  • 108
  • 144
WeekendCoder
  • 915
  • 3
  • 11
  • 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

9

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
  • 53,704
  • 14
  • 91
  • 128
mnagel
  • 6,729
  • 4
  • 31
  • 66