Skip to content

Instantly share code, notes, and snippets.

@johnregan3
Last active December 19, 2018 05:29
Show Gist options
  • Save johnregan3/50d95cf4cc4376b0b733efb8043af1de to your computer and use it in GitHub Desktop.
Save johnregan3/50d95cf4cc4376b0b733efb8043af1de to your computer and use it in GitHub Desktop.
Add Full Width Image Support in a WordPress Theme - CSS
.alignwide {
/* Set these margins to work with your own theme. */
margin-left: -80px;
margin-right: -80px;
max-width: 100vw;
}
.alignfull {
margin-left: calc(-100vw / 2 + 100% / 2);
margin-right: calc(-100vw / 2 + 100% / 2);
max-width: 100vw;
}
.alignfull img {
width: 100vw;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment