javascript - switching out link text on hover - transition -
looking simple solution replacing text on link on :hover. want slight transition (text comes underneath) , replace regular if java turned off.
html
<div class="bot-text"> <a href="">go here</a> <a href="">or go here</a> </div>
css
.bot-text { font: 600 15px/20px 'open sans', sans-serif; color: #383737; position: relative; display: inline-block; border: 2px solid #383737; padding: 25px; margin: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }
this creates text button border , padding. on hover want text change else (will less text). want text replace current link text slide bottom on hover.
try utilizing :after
pseudo element
.bot-text { font: 600 15px/20px 'open sans', sans-serif; color: #383737; position: relative; display: inline-block; border: 2px solid #383737; padding: 25px; margin: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .bot-text a:hover { color:transparent; } .bot-text a:hover:after { opacity:0; position:absolute; left:40%; color:blue !important; content:"abc"; animation: slideup 1s ease-in 0s forwards; -moz-animation: slideup 1s ease-in 0s forwards; -webkit-animation: slideup 1s ease-in 0s forwards; } @keyframes slideup { { top:50px; } { top:25px; opacity:1; } } @-moz-keyframes slideup { { top:50px; } { top:25px; opacity:1; } } @-webkit-keyframes slideup { { top:50px; } { top:25px; opacity:1; } }
<div class="bot-text"> <a href="">go here</a> <a href="">or go here</a> </div>
Comments
Post a Comment