1.7 KiB
1.7 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d78b1367417b2b2512b0a | Use a Retina Image for Higher Resolution Displays | 0 | 使用Retina图像获得更高分辨率的显示 |
Description
width
和height
值定义为原始文件的一半。以下是仅使用原始高度和宽度的一半的图像示例: <风格>
img {身高:250px;宽度:250px; }
</样式>
<img src =“coolPic500x500”alt =“最精彩的图片”>
Instructions
img
标记的width
和height
设置为原始值的一半。在这种情况下,原始height
和原始width
都是200px。 Tests
tests:
- text: 你的<code>img</code>标签应该有100像素的<code>width</code> 。
testString: 'assert($("img").css("width") == "100px", "Your <code>img</code> tag should have a <code>width</code> of 100 pixels.");'
- text: 你的<code>img</code>标签应该有100像素的<code>height</code> 。
testString: 'assert($("img").css("height") == "100px", "Your <code>img</code> tag should have a <code>height</code> of 100 pixels.");'
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