I am working on a ASP application and the code, template and files are organized in a way that does not allow me to alter anything outside the body tag. So I am thinking about inserting the meta tags inside the body -- like this:
<!-- FEW ASP INCLUDES -->
<html>
<head>
<!-- FALLBACK TITLE AND DESCRIPTION -->
<title>Default Title</title>
<meta name="description" content="Default Description">
</head>
<body>
<!-- SOME HTML MARKUP -->
<div class="dynamic-content">
<!-- InstanceBeginEditable name="dynamic-content" -->
<!-- THIS IS WHERE I CAN WRITE ASP CODE -->
<title><%= Page.Meta.GetTitle( yada, yada ) %></title>
<meta name="description" content="<%= Page.Meta.GetDescription( yada, yada ) %>">
<!-- InstanceEndEditable -->
</div>
<!-- SOME MORE HTML MARKUP -->
</body>
</html>
I am wondering how good it is to put meta tags inside the body of an HTML document. How does it affect:
- search engines
- browsers
I would say you to use it. I found meta tags inside body on various webpages, and they are on one of top 10 searches (on google). It shows, at least to me, that searh engines don't mind if you have used this approach.
You must go ahead if there's no other way around.
If your aim is search engine optimization, then it is probably a good idea to follow the standards and put all your meta tags in the
<head>
. However, as far as browser behavior goes, if you place<meta>
tags into your<body>
they will still function. I decided to test this using multiple<meta http-equiv="refresh"/>
tags and<title>
tags in an otherwise standards-compliant document.The results of my tests:
Firefox 18, Firefox 3.6, Firefox Mobile, Chrome 24, Chrome for Mobile, Opera 12, IE6, IE8, IE10:
<meta>
tags in the body were processed.<title>
tag in the document was processed, even if it was in the body. Subsequent<title>
tags were ignored.IE9:
<title>
tags in the body were ignored.<title>
tag in the body.So, what happens when you use meta tags in the body? By and large, they seem to work fine. The meta tags will probably be processed, so if you can't put them in the head then I wouldn't fret too much.