• Resolved EgidioTX

    (@egidiotx)


    Hi.

    On my photo website I have used different photo sizes throughout the years. I would like to standardize those photos to one size no larger than a set width number. In other words, I have photos that are 800 x 800 px, others that area 1350 x 1080, and so forth. Could I use a CSS entry saying that photos should have a maximum width of 800 px, for example? If yes, what is the code?

    Egídio

Viewing 5 replies - 1 through 5 (of 5 total)
  • hannah

    (@hannahritner)

    Hey,
    Can you post a link?
    Thanks!

    Hannah

    Thread Starter EgidioTX

    (@egidiotx)

    Hannah,

    My website is here. If you need a specific example, here’s one entry. Regardless of what size I upload (lately it’s been around 1350 x 1080), I’d like to restrict the size to a smaller dimension. Also, I’d like the photo to remain centered. I know there might be a plug-in (e.g., Imsanity), but I’d prefer a CSS code or something like that.

    Thanks for looking into this.

    Egidio

    hannah

    (@hannahritner)

    Try using this css:

    .wp-block-image {
        max-width: 800px;
        margin: auto;
    }

    Is that what you’re thinking?

    Hannah

    Thread Starter EgidioTX

    (@egidiotx)

    Hannah,

    Precisely what I had in mind! Thank you for your solution. I take it that if I use a larger pixel size, e.g., 900px or 1000px, it will be fine, too. In other words, a small image won’t be affected since the code is for maximum width.

    Thank you!

    Egídio

    hannah

    (@hannahritner)

    Exactly:) Happy to help!

    Hannah

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Standardize max width for images’ is closed to new replies.