3
I wish I could rotate a div, and for that I used 'Transform', in CSS, but I would like a div to be superimposed. Here’s the code:
#divgirada {
width: 500px;
height: 500px;
background: red;
transition-duration: 1s;
}
#divgirada:hover {
transform: rotate(10deg);
}
#divparada {
width: 500px;
height: 500px;
background: blue;
margin-top: -200px;
margin-left: 200px;
}
<html>
<head>
<title>Teste de rotação</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="divgirada"></div>
<div id="divparada"></div>
</body>
</html>
The problem is that although the blue div is on top, the moment the red div rotates it overlaps the blue. How to spin the red div but make the blue div continue on top?