Hacker News new | ask | show | jobs
by user24 5152 days ago
Fair enough, but that is a technical limitation which is trivial to get around:

    <setsrc>
      <img src="foo.jpg">
      <set src="foo1.jpg" width="100">
      <set src="foo2.jpg" density="2">
    </setsrc>
Always be wary of allowing arguments that hinge on "it's not technically possible" to shut down good ideas.
1 comments

FTFY

    <imgset>
      <img src="foo.jpg">
      <img src="foo1.jpg" width="100">
      <img src="foo2.jpg" density="2">
    </imgset>
Not a good idea. Browsers that do not support imgset would show all three images using that syntax. A new element name like "<set>" would be ignored by them.
CSS to the rescue

    imgset img{display:none;}
    imgset img:first-child{display:block;}
Same with modern HTML5 tags, modernizer or any other tool would handle that for you.
Not really, what about browsers that don't support first-child? Backwards compatibility is important.