I want to show full text on cursor hover but only after 1s delay. I tried adding transition
property but it seems it doesn't apply to absolute
elements. Here's the codepen demo.
Here's the code:
.main {
display: flex;
justify-content: center;
}
.main .parent:hover .cell {
position: absolute !important;
z-index: 1 !important;
padding-right: 10px;
background: gray;
transition-delay: 1s;
}
.main .parent {
display: block;
width: 200px;
border-right: 1px solid rgb(237, 237, 236);
white-space: nowrap;
min-height: 32px;
cursor: default;
height: 32px;
padding: 5px 8px 6px;
font-size: 14px;
overflow: hidden;
}
.main .parent .cell {
line-height: 1.5;
white-space: nowrap;
word-break: normal;
pointer-events: none;
}
<main class="main">
<div class="parent">
<span class="cell">
In publishing and graphic design, Lorem ipsum is a placeholder text
commonly used to demonstrate the visual form of a document or a typeface
without relying on meaningful content.</span
>
</div>
</main>
Notice that background color is transiting properly but the full text is shown instantly as soon as I hover.
Looking for a solution to add some delay in showing full text without using any JavaScript.