0

I've been doing some tidying up on my site recently and have been making some minor adjustments to the section of each page (primarily to cut out any potential duplication). However, I just have a couple of niggling questions which I thought I'd ask you experts here for your advice on...

1) Does the order of the meta tags make a difference? 2) Does the mixed use of ' or " make a difference for SEO-purposes? - ie: below in my example the canonical line uses " and then ' for the actual href (if that makes sense?

My example

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<link rel="stylesheet" href="/styles.css" />
<title>Example Page Title</title>
<link rel="canonical" href='http://www.example.com/examplepage/' />
<meta name="description" content="This is an example description"/>
</head>

Also, I have the following above my head - is this even needed any more?:

<!--[if IE 8]><html class="no-js lt-ie9" lang="en" ><![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->
  • 2
    Your three questions aren’t closely related, so it doesn’t make sense to have them in the same post. – unor May 7 '17 at 17:36
  • "is this even needed any more?" - Which bit are you referring to specifically? Just the conditional comments? – MrWhite May 7 '17 at 23:16
  • yep - the conditional comments part - sorry - should have made this clearer. – Lee May 8 '17 at 6:44
1

I would say whether it is the order of tags or using a single vs double quote, it should be fine to use.

The only thing I would say is, go with the best practice and mostly it's double quote and as far as order is concerned I would say the same.

Browsers: Generally browser renders it fine but you never know some rare issue may come in.

SEO: From SEO side it doesn't matter much as Google does beautiful job dealing with incorrect markup also.

Note: Clean code with best practice will avoid any possible issues and it also helps you manage it effectively. For example: If you need to do a bulk find and replace multi-line heard code then consistency will play an important role.

Hope this helps.

| improve this answer | |
  • Thanks, Top QnA. Your point on consistency is a great one. For that reason alone, maybe I should stick with the ". – Lee May 8 '17 at 6:45
  • Everyone has their own way of dealing with code but best practice brings better consistency. – TopQnA May 8 '17 at 7:00
3

The order of meta tags does not make a difference.

You can use both ' and " in html5.

The conditional comments can be useful if you want to create specific CSS for Internet Explorer 8. However in many sites the number of IE8 users is small, so it's up to you to decide if it's worthwhile (and needed) to do it.

| improve this answer | |
  • 1
    You can use either ' or " in any version of HTML. In HTML5 you can remove the quotes altogether (providing you don't have spaces in the attribute value). – MrWhite May 7 '17 at 23:15
0

In most cases, browser does not have a problem to render your pages because of meta tags , However the better the order the better for you to keep track of what you adding into the site. It is on best practice to put all meta tags on head section.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.