1

I'm using WordPress 4.9.4. Ive noticed that when viewing my blogs on a mobile, the images are far too wide. I'm sure this never used to happen, but don't quote me on this.

Anyway, as part of debugging I noticed the srcset attribute on all my images. And I understand what this functionality is providing by reading this post.

However, my images are not getting resized accordingly - they are staying at full size (I've tried in different browsers, clearing caches and chrome ingognito mode). And I have a feeling it's because when they have been inserted into each post, they have 'height' and 'width' attributes on every image tag.

Moving forwards i can probably use this method. But what do I do with all my historic posts? Is including the height and width attributes good or bad practise in relation to srcset?

Thanks.

Samvel Aleqsanyan
  • 2,812
  • 4
  • 20
  • 28
Captain_Planet
  • 1,228
  • 1
  • 12
  • 28

1 Answers1

0
.your-post img {
    max-width: 100%;
    height: auto;
}

if I understood you correctly.