'Button with one side edge [duplicate]

Button with one side cut corner not radius

I am trying using radius but its curve shape -- Using border property or any other CSS property trying to do without using absolute positioning enter image description here



Solution 1:[1]

You can get some ideas from below

HTML

<div class="button">Buy Now</div>

CSS

.button {
  /* outline: solid 1px green; */
  width: 150px;
  height: 70px;
  overflow: hidden;
  position: relative;
  margin: 1em;
  color: #fff;
}

.button::before {
  content: ' ';
  display: block;
  background: #d33;
  width: 200px;
  height: 200px;
  transform: rotate(45deg);
  position: relative;
  top: -100px;
  right: 50px;
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mohit Khedkar