Defeating your Foe: the Red Dot is Ours!
To Come...
img
标签必须有一个alt
属性。在图片已经有了文字说明,或者仅仅为了美化页面的情况下,alt
属性似乎有些多余。
即便如此,我们仍然需要为img
标签添加alt
属性,这时可以把它设为空,例如:
<img src="visualDecoration.jpeg" alt="">
背景图片通常起装饰作用,而且含有 CSS 类,所以屏幕阅读器无法读取。
注意:alt
属性,因为这样有助于搜索引擎记录图片内容。
alt
属性(注意:这里img
标签的src
属性提供的链接是无效的,因此页面上可能不会显示图片,不用担心)。
img
标签应该包含alt
属性。'
testString: assert(!($('img').attr('alt') == undefined));
- text: 'alt
属性对应的值应该为空。'
testString: assert($('img').attr('alt') == '');
```
To Come...
To Come...