2017-05-26 49 views
1

我正在一个图片库,当我试图验证代码时,它在图库中的每个图像中给出了两个错误。 此时img元素不允许属性atl。属性atl不允许在元素img在这一点

img元素必须具有alt属性,但某些 条件下除外。有关详细信息,请参阅为图像提供替代文字 的指导。 这是我的代码/:

@charset "UTF-8"; 
 
.thumbnailss { 
 
\t border-style: none; 
 
\t width: 250px; 
 
\t height: 250px; 
 
\t padding-left: 4px; 
 
\t padding-right: 4px; 
 
\t padding-top: 4px; 
 
\t padding-bottom: 4px; 
 
} 
 

 
.italic { font-style: italic; } 
 
.small { font-size: 0.8em; } 
 

 
/** LIGHTBOX MARKUP **/ 
 

 
.lightbox { 
 
\t /** Default lightbox to hidden */ 
 
\t display: none; 
 
\t /** Position and style */ 
 
\t position: fixed; 
 
\t z-index: 999; 
 
\t width: 100%; 
 
\t height: 100%; 
 
\t text-align: center; 
 
\t top: 0; 
 
\t left: 0; 
 
\t background: rgba(0,0,0,0.8); 
 
\t margin-top: 50px; 
 
} 
 

 
.lightbox img { 
 
\t /** Pad the lightbox image */ 
 
\t max-width: 90%; 
 
\t max-height: 80%; 
 
\t margin-top: 2%; 
 
} 
 

 
.lightbox:target { 
 
\t /** Remove default browser outline */ 
 
\t outline: none; 
 

 
\t /** Unhide lightbox **/ 
 
\t 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>

回答

相关问题