xhtml strict validation

liunx

Guest
i'm trying to validate my page with xhtml strict and keep on getting the message:<br />
<br />
"end tag for "xxx" omitted, but OMITTAG NO was specified" <br />
<br />
where xx is either img or link.<br />
<br />
heres a sample line:<br />
<br />
<td><br />
<a href = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"#"><img src="graphics/2_tnail.jpg" width="158px" height="140px" onclick="popimage('graphics/2.jpg',660,510);return false"></a><br />
</td><br />
<br />
what does this mean and how do i get it right?<!--content-->Try this:<td><br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#"><img src="graphics/2_tnail.jpg" alt="" style="width: 158px; height: 140px;" onclick="popimage('graphics/2.jpg',660,510);return false" /></a><br />
</td>You must close all tags when using an XHTML DOCTYPE. Even the "empty" tags (such as <img>, <input>, etc.) by adding a trailing slash onto the end of it. Also, as in previous DOCTYPEs, all <img> elements require the alt attribute.<!--content-->so what other tags do i need to add that extra ending slash to?<!--content-->All "empty" tags — these kind of tags are the tags in which don't have a matching closing tag. For example, <h1> is not an "empty" tag since it has a closing tag:<h1>foo</h1>But, <input> is since it doesn't, therefore you add a trailing slash in order to close it:<input type="text" value="foo" /><!--content-->ohhh i see. so where <img> doesn't go as <img> </img> you need to a closing tag as <img /> yeah?<br />
<br />
<br />
thanks for your help <br />
:D<!--content-->That's absolutely correct. You're welcome. :D<!--content-->Hi. I have a similar problem. I use a PHP script to add images dynamically from a MySQL database. The code I'm using is: <br />
<br />
<img src=http://www.webdeveloper.com/forum/archive/index.php/"<?php echo $row_rsShowNews['../thumbnail']; ?>" alt="<?php echo $row_rsShowNews['thumbnail_alt']; ?>" name="thumbnail_image" id="thumbnail_image" /><br />
<br />
As you can see from this I am closing the tag correctly but when I look at the source code of a page it is displayed as:<br />
<br />
<img name="thumbnail_image" src=http://www.webdeveloper.com/forum/archive/index.php/"/news-management/uploaded-images/angola.gif" alt="Flag"> <br />
<br />
It omits the closing />. Is there any way of getting this to validate??<!--content-->
 
Back
Top