[Plugin: Media Credit] Suggestion: Allow for responsive images with max-width
-
I don’t like having to edit plugins but this was a barrier toward fully fluid/responsive images for us. The absolute-value width in the shortcode output wasn’t allowing images to scale properly.
Might I suggest that instead of applying the image width in your output, apply max-width: 100% instead. I also tacked on height:auto as well.
e.g.
return '<div class="media-credit-container ' . esc_attr($align) . '" style="width: ' . (10 + (int) $width) . 'px">' . do_shortcode( $content ) . '<span class="media-credit">' . $author_link . '</span></div>';
Becomes
return '<div class="media-credit-container ' . esc_attr($align) . '" style="max-width: 100%; height:auto;">' . do_shortcode( $content ) . '<span class="media-credit">' . $author_link . '</span></div>';
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: Media Credit] Suggestion: Allow for responsive images with max-width’ is closed to new replies.