W3C 验证问题
muiz 2009-06-03 09:16:48 下面代码不通过W3C验证 ( http://validator.w3.org/#validate_by_input ):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>title</title>
</head>
<body>
<img src="img/test.png" width="116" height="215" />
</body>
</html>
提示错误:
Line 8, Column 51: required attribute "alt" not specified
<img src="img/test.png" width="116" height="215" />
The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.
Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
--------------------------------
大家有什么建议吗? 我不明白这个错误. 如果去掉img这个节点, 就可以通过验证.