Please tell me how to make such a diagonal line:
HTML :
<div class="block"></div>
CSS :
.block {
margin: 50px auto;
width: 100px;
height: 100px;
background: black;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
I am looking for information how to do it but did not find.
Try 3D transforms - something like this:
Relevant CSS :
body /* parent of .block in general */ {
-webkit-perspective: 15em;
perspective: 15em;
}
.block {
-webkit-transform: rotateX(-5deg) rotateY(10deg);
transform: rotateX(-5deg) rotateY(10deg);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.