简体   繁体   中英

rounded diagonal line css

Please tell me how to make such a diagonal line:

  • shape:

在此输入图像描述

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:

demo

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM