1

I would like to curve the hypotenuse side of this triangle div/background with CSS, so the result is something like this:

enter image description here

1
  • 1
    Not possible. You need to use SVG or canvas to draw that path. Commented Feb 22, 2021 at 8:49

2 Answers 2

3

background can do it:

.box {
  width: 200px;
  height: 150px;
  background: radial-gradient(180% 180% at right -65% top -65%, transparent 99%, red )
}
<div class="box"></div>

Sign up to request clarification or add additional context in comments.

Comments

0

Another way of doing it, matching the background you are in with a pseudo :after covering the part you need :

Althogh I like more @Temani Afif answer above.

#curved-triangle::after {
    content: "";
    position: absolute;
    top: -100px;
    left: 0px;
    background: #fff;
    width: 200px;
    height: 200px;
    border-radius: 100%;
}
#curved-triangle {
    width: 0;
    height: 0;
    border-left: 0px solid transparent;
    border-right: 100px solid transparent;
    border-bottom: 100px solid red;
    position: relative;
}
  <div id="curved-triangle"></div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.