简体   繁体   中英

W3C Validator Error

When I use W3c validater for checking my site it shows

"required attribute "alt" not specified" and also

" 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 . "

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 />标记中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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