Title: Image width within posts
Last modified: August 12, 2018

---

# Image width within posts

 *  [teabreakproject](https://wordpress.org/support/users/teabreakproject/)
 * (@teabreakproject)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/image-width-within-posts/)
 * Most of the images on my site are embedded from Flickr, which means that I have
   to set an image size, which can change based on the screen I’m viewing the site
   on. I’ve inserted some CSS that means single images will always be at 100% of
   the width of the post:
 * .single-content img {
    width: 100%; height: auto; } .page img { width: 100%; 
   height: auto; }
 * But there are a number of places where I have 2 or 3 images side-by-side, and
   in these instances I want the whole lot to be 100% width of the post, rather 
   than each individual image being this width. Is there a way of doing this?
 * Thanks.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fimage-width-within-posts%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [jarektheme](https://wordpress.org/support/users/jarektheme/)
 * (@jarektheme)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/image-width-within-posts/#post-10583478)
 * Hi there,
 * Thank you for getting in touch with us.
 * What I would recommend is to add images with clicking Add Media button and then
   select default Gallery with two or three images. To display those images in two
   or three columns you need to choose 2 or 3 columns in Gallery settings. Please
   see more information on WordPress gallery here: [https://codex.wordpress.org/The_WordPress_Gallery](https://codex.wordpress.org/The_WordPress_Gallery)
 * Hope that helps.
 * Kind regards
 *  Thread Starter [teabreakproject](https://wordpress.org/support/users/teabreakproject/)
 * (@teabreakproject)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/image-width-within-posts/#post-10584004)
 * Thanks, but that would require going back through every single old post, which
   would be incredibly time-consuming. It would also mean uploading all the images
   that are currently embedded from Flickr, which would mean using up much more 
   space, as well as making the site slower loading. I don’t mind changing the way
   I do things for future posts, but I don’t want to have to go through all my old
   posts manually reformatting all of my images. Is there not a way I can do this
   through CSS? Making each ‘line’ of images 100% of the page width?
 *  [jarektheme](https://wordpress.org/support/users/jarektheme/)
 * (@jarektheme)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/image-width-within-posts/#post-10586570)
 * I’m afraid there is no easy way to do this. That’s because there is no class 
   or any other selector we can use to set custom style to some images and exclude
   the other. All images are inside p and a tags.
 * Please note that you can use JavaScript to find images and add inline style but
   I’m not sure if this would be the best technique. To do this first you need to
   install this plugin: [https://wordpress.org/plugins/custom-css-js/](https://wordpress.org/plugins/custom-css-js/)
   and add Custom JS:
 *     ```
       setTimeout(function() {
         var paragraphs = jQuery('.single-content p');
         paragraphs.each(function(i, el) {
           var img = jQuery(el).find('img');
           if(img.length > 1) {
             jQuery(img).parent('a').css({'width': '46%', margin: '2%', 'float': 'left'});
             jQuery(el).next().css({'clear': 'both'});
           }
         });
       }, 500);
       ```
   
 * Hope that helps.
 * Kind regards

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Image width within posts’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/kale/2.8.2/screenshot.jpg)
 * Kale
 * [Support Threads](https://wordpress.org/support/theme/kale/)
 * [Active Topics](https://wordpress.org/support/theme/kale/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/kale/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/kale/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [image width](https://wordpress.org/support/topic-tag/image-width/)

 * 3 replies
 * 2 participants
 * Last reply from: [jarektheme](https://wordpress.org/support/users/jarektheme/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/image-width-within-posts/#post-10586570)
 * Status: not resolved