W3C home > Mailing lists > Public > www-style@w3.org > June 2013

Re: lazy loading for images via css

From: Sebastian Zartner <sebastianzartner@gmail.com>
Date: Fri, 28 Jun 2013 08:01:06 +0200
Message-ID: <CAERejNY7bCHOu9SmP8C7wfqsGb5eOOfkBB+BS3zUzeD3qpi3Ng@mail.gmail.com>
To: Felipe Nascimento de Moura <felipenmoura@gmail.com>
Cc: www-style <www-style@w3.org>
> article img{
>     loading-type: postponed;
> }
Disregarding the usefulness of your suggestion, the requests related to
<img> tags are initiated after reading the HTML, so this is not
controllable via CSS. (Correct me somebody if I'm wrong.)
To postpone image loading of images defined via <img>, you would therefore
have to add an attribute to the <img> tag like this:

<img src="mygreatestphoto.jpg" alt="My greatest photo!" postponed/>

Your idea could work for URLs defined within CSS, though. E.g.:

article {
    background-image: url(mygreatestphoto.jpg) postponed;


article {
    background-image: url(mygreatestphoto.jpg postponed);

Received on Friday, 28 June 2013 06:01:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:31 UTC