I am building this main nav bar, as the active/hover state I need to get the border bottom in color.
My problem is how could I round the inner top corners?
I understand that I could create an element, add a height, width, bg color and round it with border-radius,But I’d like to know if it is possible to make this with border-bottom.
I’ve attached the design so you can see what I mean. Thanks
2
Answers
The easiest way is to use a pseudo-element such as
::after
and give it a specific height. Then useborer-top-left-radius
andborder-top-right-radius
to round the corners with the equal value of the height:The easiest way is using Tailwind CSS. Run below codes in the terminal of the VS CODE.
code link that is to be run in the terminal
This way you will get ready to use TAILWIND CSS.
REMEMBER:- Code snippet will not work until codes in provided image run in the terminal of the VS Code.
Main code to make the bottom of an element rounded border-2 rounded-b-lg