I have a demo application in which I want to show the Play and Pause icon.I am able to make a play and pause Icon. But there is another requirement I need to show PLAY and PAUSE TEXT on hover
I am facing two issues.
- My icon is Jumping above when I hover to button
- PLAY or PAUSE text not coming centre.(It is showing slightly below )
- How to show different text depending state;
Here is my code https://jsbin.com/qifigeruti/3/edit?html,css,js,output
.container {
padding: 8px;
border: 1px solid;
display: inline-block;
}
.text {
display: none;
}
.button {
border: 0;
background: transparent;
box-sizing: border-box;
width: 0;
height: 20px;
border-color: transparent transparent transparent #202020;
transition: 100ms all ease;
cursor: pointer;
border-style: solid;
border-width: 10px 0 10px 20px;
padding: 0
}
.button.paused {
border-style: double;
border-width: 0px 0 0px 20px;
}
.button:hover {
border-color: transparent transparent transparent #404040;
}
.button:hover span {
display: inline;
}
<div class="container">
<button class='button'>
<span class="text">Play</span>
</button>
</div>