[wp-trac] [WordPress Trac] #17044: div.wp-caption shortcode should have width of img, rather than add +10px

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 27 07:21:08 UTC 2012


#17044: div.wp-caption shortcode should have width of img, rather than add +10px
-------------------------------+------------------------------
 Reporter:  mgk25              |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Shortcodes         |     Version:  3.1
 Severity:  normal             |  Resolution:
 Keywords:  close 2nd-opinion  |
-------------------------------+------------------------------

Comment (by grahamarmfield):

 Replying to [comment:12 azaozz]:
 > Still haven't seen a single case where removing these 10px would make
 styling images with captions any easier/better, or even any different.
 Removing the width completely will make some difference for floated
 images, however there doesn't seem to be a straightforward way to center a
 caption without it.

 As a theme developer it's always easier to style something that doesn't
 have inline styles already added. And to take an example from a design I'm
 doing for a client right now there is a requirement for images with
 captions to have a fine border round the caption and the image together
 but with no padding. I have had previous projects as well where the extra
 10px has been a real pain.

 As far as I can tell, removing the style="width: nnn" from the wp-caption
 div seems to make no difference to the display - even if it's floated left
 or right. It's possible to centre the caption itself by placing text-
 align:center on wp-caption div in your stylesheet. Or does this conflict
 with older IE versions? If so, maybe targeting the actual caption
 paragraph could be done.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17044#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list