简体   繁体   English

W3C验证:此时元素a上不允许属性alt

[英]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.

相关问题 W3C验证错误:“目前,元素meta上不允许使用属性名称。” - W3C validation error: “Attribute name not allowed on element meta at this point.” 我不明白这个错误“此时元素 iframe 上不允许使用属性 iframe”。 w3c - I don't understand this error "Attribute iframe not allowed on element iframe at this point." w3c W3C验证错误:没有属性“占位符” - W3C validation error: there is no attribute “placeholder” W3C验证错误:span元素 - W3C validation error: span element W3C标记验证服务说 <body> 标签不允许 - The W3C Markup Validation Service says a <body> tag is not allowed W3C错误验证 - 元素a上属性href的错误值:查询中的非法字符:不是URL代码点 - W3C error validating - Bad value for attribute href on element a: Illegal character in query: not a URL code point 属性“ lang”存在,但不能用于此元素。 W3C验证错误 - Attribute “lang” exists, but can not be used for this element.? W3C validation error 在角度js {{i.link}}中,元素a的属性href显示w3c验证错误 - In angular js {{i.link}} for attribute href on element a showing w3c validation error W3C验证查询中的非法字符:不是URL代码点 - W3C validation Illegal character in query: not a URL code point W3C验证:标签内的有序列表元素 - W3C Validation: Ordered List element inside Label
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM