Sliding text button - HTML CSS CSS Form

HTML CSS examples for CSS Form:input button text

Description

Sliding text button

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

a{<!--from  w w w .j  a v  a2 s .com-->
   color: white;
   font-weight: bold;
   text-decoration:none;
   text-align: center;
   display:block; /* important */
}
.blue-btn, .first-link{
   -webkit-transition: 1s;
   -moz-transition: 1s;
   -ms-transition: 1s;
   transition: 1s;
}
.blue-btn, .second-link{
   -webkit-transition: 1s;
   -moz-transition: 1s;
   -ms-transition: 1s;
   transition: 1s;
}
.blue-btn{
   height: 64px;
   width: 200px;
   line-height: 64px;
   overflow: hidden;
   background-color: #3b5998;
}
.blue-btn:hover{
   background-color: #ff0000;
}
.first-link{
   margin-top: 0px;
   margin-left: 0px;
}
.second-link{
   margin-top: -64px;
   margin-left: 300px;
}
.blue-btn:hover .first-link{
   margin-left: -300px;
}
.blue-btn:hover .second-link{
   margin-left: 0px;
}


      </style> 
 </head> 
 <body> 
  <div class="blue-btn"> 
   <a class="first-link" href="https://yahoo.com"> First Text </a> 
   <a class="second-link" href="https://google.com"> Second Text </a> 
  </div>  
 </body>
</html>

Related Tutorials