Site logo

Archived topic

Responsive image size in post

5 replies · Started by Roy on June 17, 2017

Viewing posts 1–6 of 6

Hi there,

The image is responsive.

It's just that the image is smaller than the container width even when the smallest screen is used.

You can use the hide-on-desktop hide-on-tablet hide-on-mobile classes if you want to insert different size of images at different devices?

Let me know if this helps.

Yes I understand...
There is an option not to hide the image...maybe use media querys...?

Yup you could do something like this:

@media (max-width: 768px) {
    /* CSS in here for mobile only */
    .entry-content img {
        max-width: 200px;
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    /* CSS in here for tablet only */
    .entry-content img {
        max-width: 400px;
    }
}
@media (min-width: 1025px) {
    /* CSS in here for desktop only */
    .entry-content img {
        max-width: 600px;
    }
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

awesome! great!

Great!

This archived topic is closed to new replies.