PDA

View Full Version : Make Simple HTML %-Valid-%


Cuc Tu
05-23-2011, 01:22 PM
I'm writing HTML code strings out of a database and just trying to keep it as simple as possible. Some items I've not figured out how to get valid markup without having to go to a full style definition, which would be very difficult.

What I have is a 3 row, 2 column table.

The top row is table heading and just has a background image to allow a smooth transition between the columns.

The center row is content with an image in the left td cell, and text in the right td cell. I want to use the h1 tag for larger text, and separate each text line by a ruling line.

The bottom row is a mirror of the top row to do the same thing.


HTML Header:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Uber Documentation</title>
</head>



Errors:


Line 95, Column 30: there is no attribute "BACKGROUND"
<th height=57px background="../Autorun/HeaderLeftGreen.jpg"><a href="h…✉
You have used the attribute named above in your document, but the document type you are using
does not support that attribute for this element. This error is often caused by incorrect use of the
"Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type
to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight"
(this is usually fixed by using CSS to achieve the desired effect instead).


I am using transitional loose dtd?


Line 101, Column 245: document type does not allow element "H1", "H2", "H4" here; missing one of
"APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag

<h1>Uber Instruments</h1><h2>Product Documentation</h2><h4>Disc content...</h4>

The mentioned element is not allowed to appear in the context in which you've placed it;
the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned.
This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>")
inside an inline element (such as "<a>", "<span>", or "<font>").



It appears that using heading tags is not allowed within a table cell. All I really need is the various text sizes in white color...



Line 187, Column 11: there is no attribute "COLOR"
<hr color="#009966" align="left" width=800>✉
You have used the attribute named above in your document, but the document type you are using does not support that
attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that
uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary
extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case)
and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.
If you received this error when using the <embed> element to incorporate flash media in a Web page, see the
FAQ item on valid flash.


Also

Line 213, Column 95: document type does not allow element "HR" here; missing one of
"APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag

…80-00280B.pdf" target="_blank">Uber Guide</a><hr color="#009966" width=400>✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are
the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing
element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>")
inside an inline element (such as "<a>", "<span>", or "<font>").



I just need a greenish line separating <h1> elements in a table cell. It just seems that the HR element with a color attribute is not allowed.

Maybe I should just use "-----------------------------" to get my line...