I am just working a game and was creating a custom button tooltip and observed something very string.
Here is first snippet with out filter
button{
padding: 5px;
}
button:hover::after{
content: "A quick brown fox jumped over a lazy dog";
position: absolute;
left: 60px;
background: gray;
color:white;
}
<button><span>Text</span></button>
Snippet with filter
button{
padding: 5px;
filter: brightness(0.8)
}
button:hover::after{
content: "A quick brown fox jumped over a lazy dog";
position: absolute;
left: 60px;
background: gray;
color:white;
}
<button><span>Text</span></button>
When I use filter: brightness
on button the text of ::after
started wrapping. I can't think of any relation between filter
and wrapping of ::after
. I know I can fix that using white-space:nowrap
. But I want to know the reason why the text started wrapping when I used filter()