When hovering over the second, third, or fourth item, hidden text will appear on the left side.
If you hover your cursor over the hidden text, it will disappear again.
I want to be able to hover over the second item, move my cursor to "hide", and click on it. Can this be achieved with CSS or JS?
The HTML:
<div class="container">
<div class="item">item
<div class="hide">hide</div>
</div>
<div class="item">item <div class="hide">hide</div></div>
<div class="item">item <div class="hide">hide</div></div>
<div class="item">item <div class="hide">hide</div></div>
</div>
The CSS:
.container {
display: flex;
position: relative;
}
.item {
padding: 1px;
cursor: pointer;
}
.hide {
opacity:0;
position:absolute;
left:0;
}
.item:hover .hide {
display:block;
opacity: 1;
}
I attempted to increase the width of the hide element, but it did not work as intended
.hide {
width:100vw;
}
Is there a way to expand the width of the hide element, or another method to ensure the "hide" function remains accessible even when the parent element is not hovered over?