【发布时间】:2012-09-18 11:54:35
【问题描述】:
当我使用 W3c 验证器检查我的网站时,它会显示
“未指定所需属性“alt”” 以及
" 上面给出的属性对于您使用过的元素是必需的,但您已经省略了它。例如,在大多数 HTML 和 XHTML 文档类型中,“脚本”上需要“类型”属性元素和“img”元素需要“alt”属性。类型的典型值是 type="text/css" for 和 type="text/javascript" for . "
我该如何解决这个问题?
截图:
这是我的编码:
protected string GetImageStyle(ImageStub image)
{
if (!image.ImageID.IsNull)
{
image = image.ScaleOptimalWidth(75, 75);
return String.Format("width:75px;height:75px;align='left';-moz-border-radius: 6px;-webkit-border-radius: 6px;border-radius: 6px; padding-left: 2px;alt='img';");
}
return "width:75px;height:75px;align='left';alt='img'";
}
【问题讨论】:
-
帮我们看看你的代码目前是什么。
标签: asp.net html image xhtml w3c-validation