On this page there is an image for which I used your [caption]
shortcode, and the <div>
your shortcode created is behaving strangely.
http://staging.jeremyborum.com/author/
Most of the time it looks fine, but on very small mobile screens the image takes up so much space that the text is extremely cramped and reads like this:
I tried to constrain it with these but was unsuccessful. I think your shortcode function overwrites my CSS, but perhaps I got the CSS classes wrong.
.wp-caption { max-width: 45% !important; } .wp-caption.alignright { max-width: 45% !important; } div .wp-caption { max-width: 45% !important; } div .wp-caption.alignright { max-width: 45% !important; }
Also, please see this screenshot. When on a large screen, when I change the max-width in the inspector it makes the div bigger and the margins become huge. The max-width property is supposed to only constrain size, not enlarge it.
How can I constrain X’s shortcode-generated wp-caption
elements to never consume more than 45% of screens, but leave them unaffected otherwise? I thought max-width was the right solution, but it hasn’t worked for me.
Thanks.