JSFiddle - React, Tailwind, and code Playground
HTML
<p id="hello"> <span id="please"> Please say </span> <a class="btn btn--alt" id="email" href="mailto:xxxx@gmail.com" data-btn-alt="xxx@gmail.com">hello.</a> </p>
CSS
#hello {
font-family: 'KeplerStd-MediumDisp';
font-size: 42px;
letter-spacing: 1px;
color: #222222;
}
#email {
text-decoration: none;
color: #222222;
border-bottom: 3px solid #222222;
content: 'hello.';
display: inline-block;
list-style-type: none;
white-space: nowrap;
/* proposing line height + padding */
line-height: 30px;
-webkit-transition: border 500ms ease;
-moz-transition: border 500ms ease;
-ms-transition: border 500ms ease;
-o-transition: border 500ms ease;
transition: border 500ms ease;
}
#email:hover {
border-bottom: 3px solid transparent;
}
.btn--alt:hover {
font-size: 0;
}
.btn--alt:hover:after {
content: attr(data-btn-alt);
font-family: 'KeplerStd-MediumDisp';
font-size: 42px;
letter-spacing: 1px;
color: #222222;
word-wrap: break-word;
}
JavaScript
$(".btn--alt").hover(
function () {
$("#please").fadeOut();
},
function () {
$("#please").fadeIn();
}
);