Home > OS >  how to create shape with half square and curved shape uisng css and html
how to create shape with half square and curved shape uisng css and html

Time:12-29

i am trying to draw a shape exactly given in the image below

enter image description here

here is my html and css code which gives shape somewhat similar to this but in single color i am not getting how can i do it in multicolor. Can anybody explain me how i can do it. Thanks in advance.

.right-angle-triangle-semicircle {
  width: 100px;
  height: 100px;
  background: #FFA6DF;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 50%;
  border-bottom-left-radius: 0;
}
<div ></div>

CodePudding user response:

Just use background:linear-gradient

Here you can check the documentation about linear-gradient

.right-angle-triangle-semicircle {
  width: 100px;
  height: 100px;
  background: #FFA6DF;
 background: linear-gradient(-45deg, #f0f0f0 0%, #f0f0f0 50%, #FFA6DF 50%, #FFA6DF 100%);
  
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 50%;
  border-bottom-left-radius: 0;
}
<div ></div>

CodePudding user response:

also you can use after or before

.right-angle-triangle-semicircle {
          width: 100px;
          height: 100px;
          background: #FFA6DF;
          border-top-left-radius: 0;
          border-top-right-radius: 0;
          border-bottom-right-radius: 50%;
          border-bottom-left-radius: 0;
          position: relative;    
        }
        .right-angle-triangle-semicircle:after {
            content: '';
            position: absolute;
            width: 0px;
            height: 0px;
            border-top: 70px solid transparent;
            border-bottom: 70px solid transparent;
            border-left: 70px solid #ccc;
            transform: rotate(225deg);
            top: -45px;
            left: -10px;
        }
<div ></div>

  • Related