当我使用W3C validater检查我的网站,它显示W3C校验错误
“必需属性‘ALT’未指定”,也
“是必需的元素上面给出的属性,该属性例如,在大多数HTML和XHTML文档类型中,“script”元素需要“type”属性,“img”元素需要“alt”属性。 type的值为type =“text/css”,type =“text/javascript”为。“
我该如何解决这个问题?
截图:
这是我的编码:
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'";
}
给我们一个小提示,看看你的代码是什么。 –