Mastodon github.com/rknightuk proven.lol/aaecd5

Automatically Resize Images in Posts on Wordpress with CSS

posts 2012-03-23

Quick tip for something that I just worked out on how to automatically resize a large image to the maximum width of your Wordpress post section:

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

Simply change the .post class to the name of your post class/ID and any images larger than the size of your post section will automatically resize.

Popular Posts

Analytics powered by Fathom