我正在制作一个图像库,当我尝试验证代码时,库中的每个图像都出现两个错误。 此时元素 img 上不允许使用属性 atl。
An img element must have an alt attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images. This is the code I have/:
@charset "UTF-8";
.thumbnailss {
border-style: none;
width: 250px;
height: 250px;
padding-left: 4px;
padding-right: 4px;
padding-top: 4px;
padding-bottom: 4px;
}
.italic { font-style: italic; }
.small { font-size: 0.8em; }
/** LIGHTBOX MARKUP **/
.lightbox {
/** Default lightbox to hidden */
display: none;
/** Position and style */
position: fixed;
z-index: 999;
width: 100%;
height: 100%;
text-align: center;
top: 0;
left: 0;
background: rgba(0,0,0,0.8);
margin-top: 50px;
}
.lightbox img {
/** Pad the lightbox image */
max-width: 90%;
max-height: 80%;
margin-top: 2%;
}
.lightbox:target {
/** Remove default browser outline */
outline: none;
/** Unhide lightbox **/
display: block;
}
<!-- thumbnail image wrapped in a link -->
<a href="#img1">
<img src=../images/night/night_thumbnails/night_thumbs_01.jpg" atl="Monument Valley" class="thumbnailss">
</a>
<!-- lightbox container hidden with CSS -->
<a href="#_" class="lightbox" id="img1">
<img src="../images/night/night_thumbnails/night_thumbs_01.jpg" atl="Monument Valley">
</a>
最佳答案
关于html - 此时元素 img 上不允许使用属性 atl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44192610/