[wp-trac] [WordPress Trac] #12861: Bad float styling in Media Library?

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 5 16:48:54 UTC 2010


#12861: Bad float styling in Media Library?
--------------------------+-------------------------------------------------
 Reporter:  dougal        |       Owner:               
     Type:  defect (bug)  |      Status:  new          
 Priority:  low           |   Milestone:  Unassigned   
Component:  Media         |     Version:  3.0          
 Severity:  minor         |    Keywords:  media library
--------------------------+-------------------------------------------------
 Observed in Firefox 3.6.3, but not in Chrome.

 When browsing the media library, the thumbnails can exhibit a "stairstep"
 effect, due to being larger than their containing div.

 It appears that this stems from an element style in the `get_media_item()`
 function of `wp-admin/includes/media.php` (line 1232). The inline style on
 the image gives a margin-top of 3px. But there is already a stylesheet
 style which gives an all-around margin of 2px. I believe that the 2px
 value is correct.

 The containing element is getting its 36px height from the image name and
 the 'show/hide' link. But the thumbnail images (or 'pinkynail' images, as
 the CSS class calls them) are 32px square, plus the margins. The
 stylesheet margins would be 2px each for top and bottom, and so would also
 be 36px. But the inline style giving 3px for the margin-top results in a
 37px height, causing the floated image to "poke out" of the bottom, so
 that the next image moves right to accommodate it.

 The inline style seems unnecessary anyhow. So my patch simply removes it.
 Another option would be to add a "clear: left" to the `#media-items
 .media-item` rule in `wp-admin/css/media[.dev].css`.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12861>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list