[英]W3C Validation: Attribute alt not allowed on element a at this point
While running through the W3C validation service
, I encountered this error message: 在运行
W3C validation service
,我遇到了以下错误消息:
Attribute alt not allowed on element a at this point.
此时元素a上不允许使用属性alt。
The validator complains after the "Four Fortune 500 Companies reside: " content. 验证人在“四大财富500强企业居住地”之后抱怨。 Here is my
HTML
markup: 这是我的
HTML
标记:
<div id="container">
<header>
<h1><a href="index.html">Metropolitan+<b>Seattle</b></a></h1>
<nav>
<ul>
<li><a href="buildings.html">Buildings</a></li>
<li id="contact">Contact Us</li>
</ul>
</nav>
</header>
</div>
<div class="image-section">
<img src="img/seattleskyline.jpg" alt="Seattle Skyline" id="center-image" />
<div id="caption"><div id="caption-text">A panoramic view of 1201 Third Avenue at night</div></div>
<button id="sliderLeft" onclick="left();"></button>
<button id="sliderRight" onclick="right();"></button>
</div>
<br><br>
<div class="content">
Four Fortune 500 companies reside:
<a href="http://www.amazon.com/"alt="Amazon Website"><b>Amazon.com (#49)</b>
</a>, <a href="http://www.starbucks.com" alt="Starbucks Website"><b>Starbucks (#208)</b></a>, <a href="http://shop.nordstrom.com" alt="Nordstrom Website"><b>Nordstrom (#227)</b></a>, and <a href="http://www.expeditors.com" alt="Expeditors Website"><b>Expeditors International (#428)</b></a>.
</div>
<br><br>
您想使用title
属性,而不是alt
。
For anchor tag, alt is not a valid attribute, please use title attribute. 对于锚标记,alt不是有效属性,请使用title属性。
Please refer http://www.w3.org/TR/html4/struct/links.html 请参阅http://www.w3.org/TR/html4/struct/links.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.