Re: [whatwg] responsive images srcalt proposal

On 12/11/13, Fred Andrews <fredandw@live.com> wrote:
> The problem with a prescriptive standard for pre-loading images is that it
> might be abused by content authors for other purposes.  I would like to see
> UAs able to implement a wide range of image loading strategies using the
> available information, including ignoring any pre-loading hints, and this
> might be necessary for reloading from a cache.
>
> I am open to other ways to specify the available images, and there have been
> many proposals.
>
A src property in css:

@media only screen and (max-width: 500px) {
  #main-pic {
    src: url("/img/main-100.png");
  }
}

<img src="main.jpg" alt="San Diego Zoo">

Unsupported browsers use the HTML src attribute.

Newer browsers download the src only for the most specific matching
CSS for that replaced element and img.src is the img.usedSrc are the
images source that are applied, img.getAttribute("src") is the HTML
attribute.
-- 
Garrett
@xkit
ChordCycles.com
garretts.github.io

Received on Sunday, 15 December 2013 23:20:05 UTC