gpt4 book ai didi

html - 此时元素 img 不允许属性 atl

转载 作者:行者123 更新时间:2023-11-28 15:35:35 25 4
gpt4 key购买 nike

我正在制作一个图片库,当我尝试验证代码时,它在图片库中的每张图片中都出现了两个错误。此时元素 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 属性

关于html - 此时元素 img 不允许属性 atl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44192610/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com