圆角三角形

时间:2016-05-24 12:35:49

标签: html css css-shapes

我在CSS中创建三角形时遇到问题。如何制作带圆角的三角形?我必须做一些这样的事情enter image description here

2 个答案:

答案 0 :(得分:4)



.arrow-right {
  width: 5px; 
  height: 5px; 
  border-top: 60px solid transparent;
  border-bottom: 60px solid transparent;
  border-left: 60px solid green;
  border-radius:5px;
}

<div class="arrow-right"></div>
&#13;
&#13;
&#13;

答案 1 :(得分:1)

rotate + overflow会做(使用额外的元素或伪):

&#13;
&#13;
.tr {
  height:40px;
  width:40px;
  overflow:hidden;
  transform:scale(1,1.2);/* increase visual height */
  }
.tr div {/* could be a pseudo */
  width:70%;
  height:70%;
  float:right;
  background:#C20009;
  transform:rotate(-45deg);
  box-shadow: 0 0 1px, inset 0 1px 1px , inset 5px -5px 5px rgba(0,0,0,0.3);
  transform-origin: top right;
  border-radius : 8px 0 0 0 /* and the rounded corner to finish */
  }
&#13;
<div class="tr">
  <div></div>
</div>
&#13;
&#13;
&#13;