WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 21 months ago

Last modified 21 months ago

#12861 closed defect (bug) (worksforme)

Bad float styling in Media Library?

Reported by: dougal Owned by:
Milestone: Priority: low
Severity: minor Version: 3.0
Component: Media Keywords: has-patch needs-testing
Focuses: Cc:

Description

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.

Attachments (2)

media.php.diff (588 bytes) - added by dougal 4 years ago.
Remove inline style from thumbnail image in media library browser
12861.diff (655 bytes) - added by wojtek.szkutnik 4 years ago.

Download all attachments as: .zip

Change History (10)

dougal4 years ago

Remove inline style from thumbnail image in media library browser

comment:1 dougal4 years ago

  • Keywords has-patch added

comment:2 ocean904 years ago

  • Keywords media library has-patch removed
  • Milestone changed from Unassigned to Future Release

At the moment I can't see a problem here. In Future we will reworking the media part.

comment:3 wojtek.szkutnik4 years ago

The problem still exists. Take a look at http://wojtekszkutnik.com/temp/20100812-99c-2kb.jpg - it's an example from my media gallery. Clearly, the top margin is too big.

wojtek.szkutnik4 years ago

comment:4 wojtek.szkutnik4 years ago

  • Cc wojtek.szkutnik@… added
  • Keywords has-patch needs-testing gsoc added

Refreshing the patch

comment:5 dougal21 months ago

  • Resolution set to fixed
  • Status changed from new to closed

This bug is ancient, and I haven't seen it happen in a long time. Going to go ahead and flag it as fixed.

comment:6 ocean9021 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:7 ocean9021 months ago

  • Keywords gsoc removed
  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from reopened to closed

comment:8 SergeyBiryukov21 months ago

Appears to be fixed in [19262] (the change suggested in 12861.diff was made there).

Note: See TracTickets for help on using tickets.