TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Improved support for high-resolution displays with the srcset image attribute

22 pointsby cheeaunalmost 12 years ago

1 comment

bsimpsonalmost 12 years ago
Glad to see the browsers supporting modern hardware in a more reasonable way, but for most non-photo images, this seems like a better strategy:<p>&lt;img src = &quot;my_icon.svg&quot; this.onerror = &quot;my_icon.png&quot; &#x2F;&gt;<p>SVG is future-proof, scaling elegantly to match whatever display it&#x27;s being viewed on. And, if you don&#x27;t care about supporting older versions of IE, you can skip the onerror, leaving you with only one asset per image to maintain.
评论 #6206783 未加载