Skip to content

Instantly share code, notes, and snippets.

@gunnarbittersmann
Created March 30, 2015 21:22
Show Gist options
  • Select an option

  • Save gunnarbittersmann/580af6d02d3425e99d80 to your computer and use it in GitHub Desktop.

Select an option

Save gunnarbittersmann/580af6d02d3425e99d80 to your computer and use it in GitHub Desktop.
fake hexagon mask
/**
* fake hexagon mask
*/
div
{
width: 200px;
position: relative;
}
div::before, div::after
{
content: "";
position: absolute;
top: -30px;
right: 0;
bottom: -36px;
left: 0;
border: solid 0 white;
border-width: 50px 0 100px;
}
div::before
{
transform: rotate(30deg);
}
div::after
{
transform: rotate(-30deg);
}
img
{
max-width: 100%;
max-height: 100%;
}
<div>
<img src="https://upload.wikimedia.org/wikipedia/commons/1/17/Vitruvian.jpg" alt="Vitruvian Man by Leonardo da Vinci"/>
</div>
// alert('Hello world!');
{"view":"split","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