Created
July 3, 2018 08:21
-
-
Save wad3g/0c6d7e1397e2dacdbd198d5cda037451 to your computer and use it in GitHub Desktop.
Parallelogram with transform: skew
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<img src="https://picsum.photos/500/300?image=0"> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container { | |
transform: skew(-15deg); | |
overflow: hidden; | |
} | |
.container img { | |
display: block; | |
transform: skew(15deg); | |
width: 130%; | |
height: auto; | |
margin: auto -15%; | |
} | |
html { background: #222; height: 100%; display: flex; } | |
body { margin: auto; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment