I am trying to achieve something like this in HTML/CSS (TailwindCSS):
Notice how the border on the active tab aligns perfectly with the full-width border.
CODE:
Here is my HTML which includes the tailwind css classes.
<link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet"/>
<div class="bg-slate-800 rounded-md mb-5 p-8">
<ul class="flex items-center mb-4 border-b-2">
<li class="p-4 border-b-2 border-red-500">
<a href="" class="font-semibold block">First Tab</a>
</li>
<li class="p-4">
<a href="" class="font-semibold block">Second Tab</a>
</li>
<li class="p-4">
<a href="" class="font-semibold block">Third Tab</a>
</li>
</ul>
<div>
tab content
</div>
</div>
Notice how the red border isn't perfectly aligned to the full-width border.
How can I get things perfectly aligned?



liis inside theulwhich has it's own border. You'd have to drop theliby the width of it's border. So something likemargin-bottom: -2pxso that thelinow covers theulborder.