The theme I am using has pre-generated code to automatically resize images with the window size:
/*
Resize images to fit the main content area.
- Applies only to images uploaded via WordPress by targeting size-* classes.
- Other images will be left alone. Use "size-auto" class to apply to other images.
*/
img.size-auto,
img.size-full,
img.size-large,
img.size-medium,
.attachment img,
.widget-area img {
max-width: 100%; /* When images are too wide for containing element, force them to fit. */
height: auto; /* Override height to match resized width for correct aspect ratio. */
}
It works perfectly, except if I put a caption with the image the code doesn’t apply to the caption box (I don’t think its a div) which goes around the image. How can I modify this CSS to resize images with captions in the smae way?