此时元素 img 不允许属性 atl
Attribute atl not allowed on element img at this point
我正在制作图片库,当我尝试验证代码时,它在图片库中的每张图片中都出现了两个错误。
此时元素 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>
atl
属性错误,alt
属性正确。
Read More : https://www.w3schools.com/tags/att_img_alt.asp
变化:
atl
属性
至
alt
属性
我正在制作图片库,当我尝试验证代码时,它在图片库中的每张图片中都出现了两个错误。 此时元素 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>
atl
属性错误,alt
属性正确。
Read More : https://www.w3schools.com/tags/att_img_alt.asp
变化:
atl
属性
至
alt
属性