[wp-trac] [WordPress Trac] #26256: SVG images get width and height attributes with values 1

WordPress Trac noreply at wordpress.org
Fri Mar 21 04:07:43 UTC 2014


#26256: SVG images get width and height attributes with values 1
--------------------------+------------------------------
 Reporter:  lippe         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by arippberger):

 There is a simple CSS fix to get SVG images set to 1x1 to fill their
 container. Here is the CSS code to fix the issue for the admin featured
 image section:

 {{{
 #postimagediv .inside img {
    max-width:100%;
    height:auto;
    width:auto; /*this line has been added*/
 }
 }}}

 Adding "width:auto" lets the SVG fill its container in Chrome (webkit) and
 Firefox. IE 9-11 don't seem to have an issue with displaying the 1x1 SVG
 without the CSS addition.

 I've attached a patch which should fix this issue (updates CSS of
 "#postimagediv .inside img").

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


More information about the wp-trac mailing list