Greetings and many thanks in advance for lending your assistance and patience. I am fairly new to the world of CSS and have yet to navigate the realm of transitions.
Present before you is a modest div encompassing a background image with a text-block overlay. Prior to the implementation of the CSS hover effect, the codepin stands as follows: http://codepen.io/miskellaneousness/pen/vGQoWa
<div class="col bodybox sportsb" style="background-image: url(http://i.imgur.com/Lq76c1G.jpg);">
<h3><a href="generic-article.html" class="hvr-sci">
<span class="singleline">
Shall It Be the Kayak or the Surfboard?
</span></a>
</h3>
</div>
Attached for your perusal is the relevant CSS:
.bodybox {
width: 23.8%;
background-color: #D5DBDB;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
height: 240px;
padding-left: 4px;
color: pink;
background-size: cover;
background-position: -18px;
}
h3 span {
position: relative;
top: 100px;
left: 10px;
width: 100%;
color: white;
font: bold 24px/45px Helvetica, Sans-Serif;
letter-spacing: -1px;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0, 0.7);
padding: 10px;
}
Upon introducing the button transform CSS, the text mysteriously vanishes. Although hovering over the text-less area triggers the button effect, the absence of text poses a notable issue. Access the Codepen inclusive of the CSS addition via the following link: http://codepen.io/miskellaneousness/pen/RaqXGy
Behold the CSS enhancements made:
.hvr-sci {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
overflow: hidden;
}
.hvr-sci:before {
content: "";
position: absolute;
z-index: -1;
left: 0;
right: 100%;
bottom: 0;
background: #f1c40f;
height: 2px;
-webkit-transition-property: right;
transition-property: right;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-sci:hover:before, .hvr-sci:focus:before, .hvr-sci:active:before {
right: 0;
}