March 26th, 2011, 08:51 AM
Join Date: Mar 2011
Time spent in forums: 39 m 56 sec
Reputation Power: 0
Matching css with external php header
My website structure is structured in this way:
i am constructing the header.php file in this way:
<css styles needed for header>
when i use the require() function in my index file which calls for the header.php file it is working but when i validate the index file, i am getting the following errors:
# Error Line 96, Column 70: document type does not allow element "html" here
<html xmlns="(URL)" lang="en" xml:lang="en">
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
# Error Line 169, Column 8: end tag for "head" which is not finished
Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>
Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists require appropriate list items (<ul> and <ol> require <li>; <dl> requires <dt> and <dd>), and so on.
what can i do to style my header in the external php file and at the same time eliminate these errors?
Thank You in advance.
Your help Much appreciated!