• Resolved stooge60540

    (@stooge60540)


    Last July, when I wanted to resize all existing images in my site’s posts, I searched around on Google for some help, found a CSS code that related to what I was looking for, inserted it into my site’s Additional CSS, and it worked. A few days ago, I had to reset a few things on my site, and unfortunately, it resulted in me losing the aforementioned CSS code, and thus, the images in my site’s posts are back to the size that I didn’t want them to be. Does anyone know what CSS code I can use to resize all existing images in my posts? The size I want them to be is medium: 250×188.

    • This topic was modified 4 years, 10 months ago by stooge60540.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • You could resize it by adding the following CSS:

    
    <img src="image_source" class="img" />
    
    .img {
        width: 250px;
        height: 188px;
    }
    

    Or a good solution is:

    
    <div class="thumb">
        <img src="image_source" />
    </div>
    
    // You could use the following CSS
    .thumb {
        width: 250px;
        height: 188px;
    }
    .thumb img {
       width: 100%
       height: auto;
    }
    

    I hope this could help you.

    Thread Starter stooge60540

    (@stooge60540)

    I put all of the info from the first gray box in your response into my Additional CSS, and got an error message saying “Markup is not allowed in CSS”. If Markup is referring to the code using the symbols “<” and “>” in the first gray box in your response, then were do I put it? Same goes for the code using the symbols “<” and “>” in the second gray box in your response. And when I tried to put the code listed under “You could use the following CSS” in your second gray box into my Additional CSS, I got some messages telling me there are errors that I must fix before I save.

    My apologies for all of these questions I’m asking, but I’m not savvy when it comes to stuff like CSS and HTML.

    • This reply was modified 4 years, 10 months ago by stooge60540.

    I used markup to give you an example in both of the cases. You only need to put the CSS part.

    
    .entry-content img {
        width: 250px;
        height: 188px;
    }
    
    Thread Starter stooge60540

    (@stooge60540)

    It worked! Thank you very much.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Resizing all existing images in all of my posts’ is closed to new replies.