2.0 KiB
2.0 KiB
id, challengeType, videoUrl, forumTopicId, title
id | challengeType | videoUrl | forumTopicId | title |
---|---|---|---|---|
587d78b1367417b2b2512b0a | 0 | https://scrimba.com/c/cPp7VfD | 1 | 针对高分辨率屏幕应使用视网膜图片 |
Description
使图像在高分辨率显示器(例如 MacBook Pro 的“视网膜显示器”)上正常显示的最简单方法是将其 width 和 height 值设置为原始文件的一半,如下所示:
<style>
img { height: 250px; width: 250px; }
</style>
<img src="coolPic500x500" alt="A most excellent picture">
Instructions
设置 img
标签的 width
和 height
为它们原始宽高的一半。在这个例子中,原始 height
和原始 width
的值都为 200px。
Tests
tests:
- text: '<code>img</code> 标签的 <code>width</code> 值应为 100px。'
testString: assert($('img').css('width') == '100px');
- text: '<code>img</code> 标签的 <code>height</code> 值应为 100px。'
testString: assert($('img').css('height') == '100px');
Challenge Seed
<style>
</style>
<img src="https://s3.amazonaws.com/freecodecamp/FCCStickers-CamperBot200x200.jpg" alt="freeCodeCamp sticker that says 'Because CamperBot Cares'">
Solution
// solution required