3
I need to create a menu with diagonal div that when you pass the mause above for color and each image contains a link to a different category.
The problem is that I can’t create a diagonal div, and I wanted to find a solution to the problem just using html and css if possible.
How can I create a mosaic menu like this?
In case just making geometric shapes does not work for me as it has the background image.
I need to distort the size of the Divs to look like the image.
Some people are saying that it is duplicate and even voting against my post, so I will show that the problem is not so simple. The problem is much deeper than the geometric shapes by which in the scheme of border do not make a background image. Just add a background color.
And by the skew you can put a background-image, but I can’t make the images have the right angle, because it distorts both sides of the angle.
#trapezoid {
border-top: 200px solid transparent;
border-left: 0px solid white;
border-right: 40px solid white;
width: 150px;
float: left;
background-image: url('http://pongnamuroms.weebly.com/uploads/1/3/3/6/13369650/144214_orig.png');
opacity: 0.7;
background-size: calc(100% + 100px);
}
#trapezoid2 {
border-bottom: 200px solid transparent;
border-left: 40px solid white;
border-right: 0px solid white;
width: 150px;
margin-left: -34px;
float: left;
background-image: url('http://www.androidspin.com/wp-content/uploads/2015/05/flow_aquablue.png');
opacity: 0.7;
background-size: calc(100% + 100px);
}
#trapezoid2:hover{
opacity: 1;
}
#trapezoid:hover{
opacity: 1;
}
<div id="trapezoid">
</div>
<div id="trapezoid2">
</div>
<div id="trapezoid3">
</div>
You have these two questions: How to create geometric shapes using CSS? and How to use links in geometric shapes?.
– Renan Gomes
@I even thought about voting for them as the same thing, but with a background image it changes a little. The techniques mentioned there work for solid colors. Border and Skew are problematic with background images. SVG is a possibility, but as it has things written inside, it is not enough to make mere polygons. I come to think that there is a very different answer here than the links indicated.
– Bacco