简体   繁体   中英

How to have a curved edge triangle

I wanted a curved edge triangle in css3.Is it possible to get it in css3 ? My code below has a normal triangle...

http://jsfiddle.net/dVbJr/

#left-triangle {
   width: 0;
   height: 0;
   border-right: 100px solid orange;
   border-top: 50px solid transparent;
   border-bottom: 50px solid transparent;
}

I wanted like this.. 在此处输入图片说明

You can do like this:

CSS

.arrow{
    width:50px;
    height:100px;
    position:relative;
    overflow:hidden;
}
.arrow:after{
    content:'';
    width:100px;
    height:100px;
    -moz-transform:rotate(45deg);
    -webkit-transform:rotate(45deg);
    transform:rotate(45deg);
    background:red;
    position:absolute;
    top:0;
    right:-70px;
    border-radius:10px;
    -moz-border-radius:10px;
}

HTML

<div class="arrow"></div>

Check this http://jsfiddle.net/dVbJr/4/

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