HTML:
- <div class="buttons is-centered">
- <a href="#" class="btnStyle">
- <span class="btnBlack"></span>
- <span class="btnTxt">TEST</span>
- </a>
- </div>
CSS:
- .btnStyle{
- position: relative;
- z-index: 0;
- background-color: red;
- padding: 14px 78px;
- overflow: hidden;
- display: inline-block;
- vertical-align: middle;
- width: auto;
- font-size: 13px;
- line-height: 2em;
- font-weight: 600;
- text-transform: uppercase;
- box-sizing: border-box;
- margin: 0;
- outline: 0;
- border-radius: 5px;
- cursor: pointer;
- }
- .btnBlack{
- background-color: #1d1d1d;
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 0;
- border-radius: 0;
- transition: height .4s ease;
- }
- .btnStyle:hover .btnBlack{
- height: 100%;
- transition: height .4s ease;
- }
- .btnTxt{
- position: relative;
- display: inline-block;
- color: white;
- }
- .btnTxt:before{
- content: "";
- width: 4px;
- height: 4px;
- border-radius: 100%;
- background-color: white;
- color: white;
- position: absolute;
- left: -10px;
- top: 11px;
- opacity: 1;
- transition: transform .5s ease .1s,opacity .5s ease;
- }
- .btnTxt:after{
- content: "";
- width: 4px;
- height: 4px;
- border-radius: 100%;
- background-color: white;
- color: white;
- position: absolute;
- right: -10px;
- top: 11px;
- opacity: 1;
- transition: transform .5s ease .1s,opacity .5s ease;
- }
- .btnStyle:hover .btnTxt:before{
- transform: translateX(-100px);
- opacity: 0;
- transition: transform, .8s ease, opacity .5s ease;
- }
- .btnStyle:hover .btnTxt:after{
- transform: translateX(100px);
- opacity: 0;
- transition: transform, .8s ease, opacity .5s ease;
- }