Search code examples
cssbordershapescornerradiusborder-radius

CSS Oval String Radius of a Triangle?


i there a way to make the largest string of this triangle an oval string like in the picture? Thanks!

    #triangle-topleft {
      width: 0;
      height: 0;
      border-top: 50px solid red;
      border-right: 100px solid transparent;
    }
  
<div id='triangle-topleft'></div>

Expected:

enter image description here


Solution

  • You can use border-bottom-right-radius: 100% on a rectangle to achieve something like this.

    #triangle-topleft {
      width: 100px;
      height: 50px;
      background-color: red;
      border-bottom-right-radius: 100%;
    }
    <div id="triangle-topleft"></div>