-1

Is there a way to make an HR that's basically a left to right triangle? So, you might have a 7 px base on the left, but it narrows to 1 px (centered vertically) on the right?

I've tried doing this with linear-gradients, but I can't get it to do 2 two-dimensional gradients.

1 Answers1

1

You should be able to do this using clip-path.

hr {
  height: 7px;
  width: 100%;
  background: black;
  border: 0;
  clip-path: polygon(100% 50%, 0 0, 0 100%);
}
<hr />

See clipath on MDN Web Docs

FranCarstens
  • 1,203
  • 8
  • 13