HTML Code and meta tags

User 170830 Photo


Registered User
41 posts

I would just like to clear up an argument with a M8
concerning meta tags/tags one in particular the <title></title> so should it be the first tag or does it not mater for instance would it be:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>your title _ home</title>
<meta name="viewport" content="width=device-width" />
<meta name="Description" content="mad house" />
<meta name="keywords" content="mad,house" />
<meta name="author" content="fwebsite design.">
<meta name="Copyright" content="Copyright (c) ">
<link rel="stylesheet" href="stylesheets/default.css" />
</head
Or would it be:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width" />
<meta name="Description" content="mad house" />
<title>your title _ home</title>
<meta name="keywords" content="mad,house" />
<meta name="author" content="fwebsite design.">
<meta name="Copyright" content="Copyright (c) ">
<link rel="stylesheet" href="stylesheets/default.css" />
</head> which is correct or does it matter I would say the title tag is the most important and should be the first tag on the page
Peter (AKA badger) :cool:
Peter aki badger I only see what I want to
User 603315 Photo


Registered User
938 posts

Well actually HTML should be the first tag on the page old chap, so your both wrong :lol::D
User 603315 Photo


Registered User
938 posts

In all seriousness, I believe your mate is right, but others may disagree
User 170830 Photo


Registered User
41 posts

LOL ya I know that but apart from the obvious we all know that part so disregarding the HTML tag see last message the <html> is the first then bla bla bla :P
Peter
Peter aki badger I only see what I want to
User 170830 Photo


Registered User
41 posts

ya like you say some would disagree but I think it does not really matter but it the SEO programs say it should be first after the title html tag that is ;)
Peter aki badger I only see what I want to
User 603315 Photo


Registered User
938 posts

badger wrote:
ya like you say some would disagree but I think it does not really matter but it the SEO programs say it should be first after the title html tag that is ;)


Yeah well maybe some more chaps and chapesses will chip in with this one
User 170830 Photo


Registered User
41 posts

as we are exchanging bit this is one of mine http://houseclearanceguildford.co.uk/
Peter aki badger I only see what I want to
User 603315 Photo


Registered User
938 posts

badger wrote:
as we are exchanging bit this is one of mine http://houseclearanceguildford.co.uk/


Very nice and responsive too ;):cool: Hope if your living in the Guildford area you have been safe and sound, know my wife has family in Surrey and been a bit hairy with the weather etc
User 122279 Photo


Senior Advisor
14,567 posts
Online Now

As far as I know,
right after <head> you should have the doctype declaration,
then the bit about the viewport,
and after that you can add all the other meta tags you want to use.
Then it's time for the <title></title> tags.
If you have links to external css and script files, now put the css in before the scripts.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 1948478 Photo


Senior Advisor
1,850 posts

Inger wrote:
As far as I know,
right after <head> you should have the doctype declaration,
[....]

That's a typo, right Inger? ;)

Surely the doctype must come first... (unless, i.e., you have some special php header code that you need right up front...)

I'm not sure that the relative order really matters between the viewport, the <meta> and <title> tags...
But then when it comes to the css and the scripts, I agree that's where the relative order starts to matter!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.