当前位置: 动力学知识库 > 问答 > 编程问答 >

css - Simple image & retina image in one img

问题描述:

I have this code:

<a href="/smi" class="media-link">

<img src="/images2/smi.png" alt="About">

</a>

smi.png - it's simple image

I have smi2.png - it's retina image

How can I set two images in this code?

网友答案:
<a href="/smi" class="media-link">
    <img src="/images2/smi.png" srcset="/images2/smi2.png 2x">
</a>

http://www.w3.org/html/wg/drafts/srcset/w3c-srcset/

分享给朋友:
您可能感兴趣的文章:
随机阅读: