[wp-trac] [WordPress Trac] #42920: Add support for the picture element

WordPress Trac noreply at wordpress.org
Sat Sep 18 00:12:58 UTC 2021


#42920: Add support for the picture element
-------------------------------------------------+-------------------------
 Reporter:  desrosj                              |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch 2nd-opinion needs-unit-    |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by strarsis):

 (Maybe this is helpful) Example HTML for using <picture> and <srcset> for
 different formats and resolutions/densities:
 {{{
 <picture>

     <source type="image/webp"
             srcset="image-1-300.webp 300w,
                         image-1-800.webp 800w"
             sizes="[...], 100vw" />

     <source type="image/jpeg"
             srcset="image-1-300.jpg 300w,
                         image-1-800.jpg 800w"
             sizes="[...], 100vw" />

     <img alt=""
          class="background"
          src="image-1-1920.jpg" />

 </picture>
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/42920#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list