Skip to content

Instantly share code, notes, and snippets.

@j-cam
Created January 26, 2016 08:05
Show Gist options
  • Save j-cam/6f1a9621d63c306e783e to your computer and use it in GitHub Desktop.
Save j-cam/6f1a9621d63c306e783e to your computer and use it in GitHub Desktop.
Wordpress: Removing Image and Caption Dimension Attributes.
/* Attribution: http://wordpress.stackexchange.com/a/37768/35516 */
.entry-content img,
.comment-content img,
.widget img {
max-width: 97.5%; /* Fluid images for posts, comments, and widgets */
}
img[class*="align"],
img[class*="wp-image-"] {
height: auto; /* Make sure images with WordPress-added height and width >attributes are scaled correctly */
}
img.size-full {
max-width: 97.5%;
width: auto; /* Prevent stretching of full-size images with height and >>width attributes in IE8 */
}
.wp-caption { max-width: 100%; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment