Skip to content

Instantly share code, notes, and snippets.

@csssecrets
Last active December 13, 2021 02:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 15 You must be signed in to fork a gist
  • Save csssecrets/7563400 to your computer and use it in GitHub Desktop.
Save csssecrets/7563400 to your computer and use it in GitHub Desktop.
Diamond images — via transforms
/**
* Diamond images — via transforms
*/
.diamond {
width: 250px;
height: 250px;
transform: rotate(45deg);
overflow: hidden;
margin: 100px;
}
.diamond img {
max-width: 100%;
transform: rotate(-45deg) scale(1.42);
z-index: -1;
position: relative;
}
<div class="diamond">
<img src="http://csssecrets.io/images/adamcatlace.jpg" />
</div>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment