How can I get a rectangle with a straight border top right radius?


pad

How to make a rectangle:

  1. First of all, is the upper right corner radius straight and not round?
  2. Second, is the left bottom radius straight and not round?

The following figure:

enter image description here

Pastor Gard

Use try something like the following clip-path. You can simply make a triangle clip path and place it where you want that edge to be the same background color as the container to make it transparent

Here is an example

.box.n1,
.box.n2 {
  position: relative;
  width: 250px;
  height: 60px;
  margin: 10px;
}

.box.n1 {
  background: red;
}

.box.n2 {
  background: blue;
}

.box.n1::before,
.box.n2::before {
  position: absolute;
  content: '';
  width: 20px;
  height: 20px;
  background: #fff;
}

.box.n1::before {
  bottom: 0;
  left: 0;
  clip-path: polygon(100% 100%, 0 0, 0 100%);
}

.box.n2::before {
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  top: 0;
  right: 0;
}
<div class="box n1"></div>
<div class="box n2"></div>

Related


How to fix the border top right radius of the image at the top

To shut up I have this layout with an image on top and a 20px radius in the top right corner. While border-bottom-left-radius is working. This is the mockup. So far this is what I got. .wrapper { margin: 10px; } .featured-block { box-shadow: 0 12px 31px 0 rg

How to fix the border top right radius of the image at the top

Shut up I have this layout with an image on top and a 20px radius in the top right corner. While border-bottom-left-radius is working. This is the mockup. So far this is what I got. .wrapper { margin: 10px; } .featured-block { box-shadow: 0 12px 31px 0 rgba(

How can I change the radius of the bottom border?

username So I checked on google and I was told the code is: border-bottom-radius: value; CHROME* of course. Well, I tried it and it doesn't seem to work. If you guys can help me, I'm here, waiting for your help! Thanks :D Buzz Jobson use border-bottom-left-ra

How can I get rid of the top border of this table header?

username I'm using bootstrap 2.3.2 and have a table with 2 headers (only 1 header is displayed at a time). this is my violin <table class="table table-hover"> <thead> <tr class="view_1"><th>Header 1</th></tr> <tr class="view_2"><th>Header 2

How can I get rid of the top border of this table header?

username I'm using bootstrap 2.3.2 and have a table with 2 headers (only 1 header is displayed at a time). this is my violin <table class="table table-hover"> <thead> <tr class="view_1"><th>Header 1</th></tr> <tr class="view_2"><th>Header 2