Tomsz Comasz Tomsz Comasz - 2 years ago 77
HTML Question

triangle with rounded corners

I have a problem with creating triangle in CSS. How make triangle with rounded corners? I have to do something lik this enter image description here

Answer Source

rotate + overflow would do (with an extra element or a pseudo):

.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 */
  }
<div class="tr">
  <div></div>
</div>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download