I've got a question which hopefully someone will be able to help out with. So I am trying to create a diamond div
shape which will itself, be a link:
Creating these a separate divs with for instance and image for the diamond with a link around it won't work in this situation due to the overflow on to the other blocks.
So my first though was to create a div
and use transform
in CSS to get this desired effect:
However, when trying to create this, get got the following:
.test {
width: 192px;
height: 144px;
transform: skewX(-40deg) rotate(25deg);
display: block;
background-color: red;
top:50px;
left:50px;
position:absolute;
}
<div class="test"></div>
By running this, you can see that within the transform attribute, both rotate and skew cannot work together as it seems the skew is affected by the rotate.
Has anyone else come across the same sort of thing when trying to create custom shapes like this? Is there another way (either CSS or Javascript) where I could get the desired effect?
Any help would be greatly appreciated. If anyone needs any further information, please let me know.
Thanks very much :)