Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to make this wedge shape has 45 degree angles at both ends.

enter image description here

As the size of its containing div changes, or the page is zoomed, that angle changes:

enter image description here

Here's my (abbreviated) code:

<div class="relative">
  <svg class="h-16p top-0 left-0 absolute w-full fill-current" viewBox="0 0 100 4" preserveAspectRatio="none">
    <polygon points="0,0 100,0 95,5 5,5" />
  </svg>
</div>

I'm using tailwindCSS - for those not familiar those classes translate to:

position: absolute;
width: 100%;
fill: currentColor;
height: 16px;
top: 0px;
left: 0px;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.3k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...