I want to have a border image over an image. The border-image isn´t straight so the overlays should lie over the image and not behind. I tried this with z-index, but doesn´t work. The border doesn´t lie over my image.
Here is the fiddle.
I have tried it with this this code:
.sprocket-mosaic-image-container {
position: absolute;
border-style:solid;
border-width: 60px 28px 87px 24px;
-moz-border-image: url(http://i.imgur.com/qfJxhX2.png) 60 28 87 24 repeat;
-webkit-border-image: url(http://i.imgur.com/qfJxhX2.png) 60 28 87 24 repeat;
-o-border-image: url(http://i.imgur.com/qfJxhX2.png) 60 28 87 24 repeat;
border-image: url(http://i.imgur.com/qfJxhX2.png) 60 28 87 24 repeat;
z-index:1;
}
.sprocket-mosaic .sprocket-mosaic-image {
position:relative;
z-index:0;
}
in my opinion border image not a good idea for this case . you can use more elements to build up that . try this one : https://jsfiddle.net/cz1k6bcn/
You can achieve that by:
Using the image as a background
Borders on an absolutely positioned pseudo element
If you must have an image tag (unknown width and height for example), you can define the borders on an absolutely positioned pseudo element on the container.