What is the best place for the viewport tag

html

Solution

If you're talking about `<meta name="viewport">` (because there's no such thing as `<viewport>`), you can put it anywhere you like, as long as you keep it somewhere within the `<head>` tag for it to be valid HTML.

It doesn't matter whether it comes before or after the `<title>` tag, `<link>` tags, or even the HTML5 shiv, because `<meta>` tags are widely supported and don't require the HTML5 shiv as they already exist in older specifications (and as mentioned, it's `<meta name="viewport">`, not `<viewport>`).

Problem

I'm wondering what is the best place to put the viewport tag. after `<title>` tag, before CSS links, before/after html5shiv (old browsers) and if possible why? Thanks in advance.

Original source