My current structure is as follows:
HTML:
<ul>
<li>
<span>asd</span> adsafsadlvjnsd
</li>
</ul>
CSS:
span {
width: 0;
}
li:hover span {
width: 60px;
}
In this setup, the content inside the span tag is hidden initially and revealed only when the item is hovered. However, if the content within the li tag is too long, it pushes the other content down. Is there a way to adjust this so that only necessary content is pushed?
I attempted using word-break but found that it didn't work for my case.
Additionally, I would like to implement a slide animation effect when hovering over the element.