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

标签 html css lightbox image-gallery

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

相关文章:

html - css 灯箱点击删除?

html - 如何避免表格或其他 hack 将文本与 HTML 5 中的选项卡对齐?

html - child 使用 ems 和 % 转义父 div 的问题

javascript - 使用 jquery 从动态添加的 html 代码调用函数

html - 我们可以更改转换速记属性中参数的顺序吗?

javascript - 如何在 Opera 中聚焦 div 以进行键盘滚动

javascript - 动态添加元素到灯箱 (Venobox) 画廊

javascript - 如何使用 jQuery 将下一个和上一个按钮添加到我的幻灯片中?

html - 为多个表格设置相同的宽度而每个表格中的内容长度不相等?

jquery - 用JQuery改变CSS中进度条的 'width'