W3C 验证:此时元素 a 不允许属性 alt
W3C Validation: Attribute alt not allowed on element a at this point
在 运行 通过 W3C validation service
时,我遇到了这个错误消息:
Attribute alt not allowed on element a at this point.
验证器在 "Four Fortune 500 Companies reside: " 内容后抱怨。这是我的 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
。
对于锚标签,alt不是一个有效的属性,请使用title属性。
在 运行 通过 W3C validation service
时,我遇到了这个错误消息:
Attribute alt not allowed on element a at this point.
验证器在 "Four Fortune 500 Companies reside: " 内容后抱怨。这是我的 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
。
对于锚标签,alt不是一个有效的属性,请使用title属性。