Imagine this scenario: I have a black box (<div>
) and pink boxes that are also divs. My goal is to make them resemble tabs, with the active one covering up the border of the parent to create a 'bridge' effect typical in tab designs.
I initially tried widening the active tab slightly so it covers the border, but ran into issues. If I set overflow-x: hidden;
, the wider part gets hidden beneath the black outline. On the other hand, setting it to auto or visible allows for scrolling, which isn't ideal.
An important requirement is that the pink boxes must have position relative.
So, what am I missing here?
EDIT: I forgot to mention a crucial detail - the black box has overflow-y: hidden
. When I add this property, the previously mentioned methods no longer work as expected.