[英]W3C Validator Error
當我使用W3c驗證程序檢查我的網站時,它顯示
“未指定必需屬性“ alt””,以及
“上面給出的屬性對於您使用的元素是必需的,但是您已將其省略。例如,在大多數HTML和XHTML文檔類型中,“腳本”元素和“ alt”都需要“ type”屬性“ img”元素需要屬性。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'";
}
將alt
屬性添加到您的<img />
標記中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.