I want to keep uploaded image inside a hexagonal frame. I generated css from this website and it works fine in some browser.
Code:
.frame-1 {
width: 300px;
height: 320px;
-webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 98%, 0% 75%, 0% 25%);
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 98%, 0% 75%, 0% 25%);
}
But, It don't work on some other major browser like firefox etc.
So, I tried to use a transparent background shaped image over the main image. But, I cannot make it working!
Code:
<div class="frame-2">
<img src="image.jpg">
<div class="mask"></div>
</div>
.frame-2 {
width: 300px;
height: 320px;
position: relative;
}
.mask {
background: url('http://i.imgur.com/M40TJ9Z.png') no-repeat;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0
}
What is the best way to make it which supports all the major browsers? Thanks in advance.