Welcome to WebmasterWorld Guest from 54.198.46.95

Forum Moderators: incrediBILL

Message Too Old, No Replies

Question about code being shown as error when validating

tag error when validating

     
6:13 am on Apr 3, 2011 (gmt 0)



I went and validated my code and most of the errors I get are similar to this one :

Line 4, character 69:

... ="text/html; charset=UTF-8" />
^

Error: element meta not allowed here; check which elements this element may be contained within


The full code is this :

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


How do I go about resolving this /> error that is being produced?
7:23 am on Apr 3, 2011 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Which DOCTYPE are you using?

The error might actually be on a preceding line.
8:56 pm on Apr 3, 2011 (gmt 0)



Sorry for the delay in responding

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
9:01 pm on Apr 3, 2011 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



You probably forgot the closing tag on a previous element.
9:15 pm on Apr 3, 2011 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



...or a closing quote, maybe. That's way up in the <head> section of your source code. It should not be too hard to look through those previous three lines to find what kind of burble slipped through.
9:18 pm on Apr 3, 2011 (gmt 0)



Those are the first three lines...
9:19 pm on Apr 3, 2011 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



If what you posted is the first four lines, then you never opened the <html> or <head> elements
9:30 pm on Apr 3, 2011 (gmt 0)



AH Im so stupid! Ugh! Can we pretend this was never asked? hahaha. wow. Thank you Tedster.
9:42 pm on Apr 3, 2011 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



I had assumed you had simply redacted the intervening lines, posting just the DOCTYPE and the line flagged as having an error.

This is, however, the point in the dialogue where I ask "Do you really need XHTML here?".
9:48 pm on Apr 3, 2011 (gmt 0)



Isnt XHTML the current standard?
10:49 pm on Apr 3, 2011 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



XHTML is an evolutionary dead-end that should never have happened.

I use HTML 4.01 Transitional or HTML 4.01 Strict for everything, and HTML 5 is coming along in bumps and starts.
12:00 am on Apr 4, 2011 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Can we pretend this was never asked?

It's the kind of "dead obvious" mistake that we all make sometimes - so no worries at all. It will probably help more than one person in the future
12:08 am on Apr 4, 2011 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Did I tell you about the time I kept getting 404 Not Found for a new script file? Spent ages in server configuration, PHP diagnostics and whatnot before eventually noticing the file was called index.hph and was in the wrong folder. Having noticed one problem and fixed it, it was more than an hour before I noticed the other problem though.
12:37 am on Apr 4, 2011 (gmt 0)



Really? index.hph? I guess everyone at all levels make small and "stupid" errors through out their life. In regards to 4.01 and XHTMl, I was told that XHTML was the way to go since I am using CSS and php with in my files which XHTML was the best to support that?
2:01 am on Apr 4, 2011 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



CSS and PHP can support any DTD. As of now I'm going with the HTML 5 DTD. As long as a page was written to be rendered in standards mode and not quirks mode, HTML 5 is completely backwards compatible with either XHTML or HTML of almost any flavor.

When it comes to XHTML, we have a great reference thread that gets into the issues pretty well Why most of us should NOT use XHTML [webmasterworld.com]

XHTML was one of those times where "everyone says" was not the best guidance to follow.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month