Jump to content

errors massage from w3 validate


xbl1

Recommended Posts

Hi; :) I write a html, and it give me the following errors massage from W3 Validate.it make me comfuse with what it said i could not use the <br>. The following are my error massage and my code. Could you tell me how to fix it, please.//////////////////////////////////////////////////Error massages as following;# Error Line 38, column 0: character data is not allowed here .Type a Country Name for you:You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>) or forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes).✉# Error Line 39, column 3: document type does not allow element "BR" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag .<br>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>").✉# Error Line 40, column 41: document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag .<input type="text" name="CName" size="50">✉# Error Line 41, column 35: document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag .<input type="submit" value="Submit">✉# Error Line 43, column 6: end tag for "FORM" which is not finished .</form>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, <head> generally requires a <title>, lists (ul, ol, dl) require list items (li, or dt, dd), and so on./////////////////////////////////////////////////////////////////My code as following;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"><html lang="en"> <head><title>  Welcome to my page </title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">html{margin: 0;padding: 0;}body { margin: 0;		   padding: 0;}#CCNameForm{ width: 400px; height: 80px; color: #eee60f; background-color: #676fd3; margin: 10% 30% 40% 30%; font: normal bold 20px arial, Helvetica, sans-serif; border: 4px solid #1418d1; padding:2px;}form{margin: 0;padding:0;}</style></head><body><div id="CCNameForm"><form name="CCNameForm" action="CCName2.php" method="post">Type a Country Name for you:<br><input type="text" name="CName" size="50"><input type="submit" value="Submit"></form></div></body></html>

Link to comment
Share on other sites

You need to put something around 'Type a Country Name for you:' e.g <p>tags or <div> or <h1> also use <br /> not <br>

Link to comment
Share on other sites

@Roondog, in HTML 4.01, it MUST be <br> rather then <br />.@xbl1, the easiest way would be to put a <div> element around the whole contents of the <form> element like so:

<form name="CCNameForm" action="CCName2.php" method="post"><div>Type a Country Name for you:<br><input type="text" name="CName" size="50"><input type="submit" value="Submit"></div></form>

Link to comment
Share on other sites

@Roondog, in HTML 4.01, it MUST be <br> rather then <br />.@xbl1, the easiest way would be to put a <div> element around the whole contents of the <form> element like so:
<form name="CCNameForm" action="CCName2.php" method="post"><div>Type a Country Name for you:<br><input type="text" name="CName" size="50"><input type="submit" value="Submit"></div></form>

Hi boen_robot;Thanks for you tell me the easiest way. It does work.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...