简体   繁体   English

W3C验证器错误

[英]W3C Validator Error

When I use W3c validater for checking my site it shows 当我使用W3c验证程序检查我的网站时,它显示

"required attribute "alt" not specified" and also “未指定必需属性“ alt””,以及

" 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 and type="text/javascript" for . " “上面给出的属性对于您使用的元素是必需的,但是您已将其省略。例如,在大多数HTML和XHTML文档类型中,“脚本”元素和“ alt”都需要“ type”属性“ img”元素需要属性。type的典型值为type =“ text / css”和。=“ type / text / javascript”。

How can I solve this issue? 我该如何解决这个问题?

Screenshot: 屏幕截图:

在此处输入图片说明

This is my coding: 这是我的编码:

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'";
    }

alt属性添加到您的<img />标记中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM