: PHP Include meta tags A website I'm currently working on is http://www.troubi.com . Please don't care to look at the source code. If I validate the website through the w3cValidator a lot of
A website I'm currently working on is www.troubi.com . Please don't care to look at the
source code.
If I validate the website through the w3cValidator a lot of errors occur all due to "invalid" meta tags. ( validator.w3.org/check?uri=http%3a%2f%2fwww%2etroubi%2ecom%2f )
If you look at the website's source you will see that everything in the meta region looks perfectly valid, and that's the curiousity.
Now comes the point, in Firebug it just looks like if all the included meta tags were just moved to the <body>!
A screenshot from Firebug:
For reference, this is the meta file that gets included: www.troubi.com/feature/meta.php
More posts by @Deb1703797
3 Comments
Sorted by latest first Latest Oldest Best
The problem is you have a hidden character between the <head> and first <meta> element. Make sure all your pages and PHP files have the correct UTF-8 encoding (you can convert them in Notepad++ or Sublime Text if you have those apps).
Edit: just tested and it's the character 'ZERO WIDTH NO-BREAK SPACE' (U+FEFF)
Okay, I figured it out. The problem was in <meta charset=utf-8 >. The problem was that it looked like normal ASCII characters, but they weren't. They were some very cryptic Unicode symbols that looked alike.
I'll add this to my hahaha, amazing bug list.
Solved by completely recreating the included file.
Thanks for your help!
There is some weird going on in there. I just tried to validate without
<!doctype html>
<html itemscope itemtype="http://schema.org/Organization">
<head>
<meta charset="utf-8">
Then I added them one after one into the code again and it validates as it should. Start with <!doctype html> then <html> -> <head> -> <meta charset="utf-8">. It then should validate with errors about itemscope. Add itemscope itemtype="http://schema.org/Organization" to the <html> tag.
Does it validate after that?
About Firebug you can't really trust it 100%.
@pritaeas - html5 don't need closing tags on tags like <meta> <img> and so on.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.