CSS Effects (11)--Button fill effect

Source: Internet
Author: User

Tags: text button set border hit Tran near HTML ack

Button Fill effect
<! DOCTYPE html><html lang= "en" ><head> <meta charset= "UTF-8" > <meta name= "viewport" content= " Width=device-width, initial-scale=1.0 "> <meta http-equiv=" x-ua-compatible "content=" Ie=edge "> <title      >Document</title> <style>. btn {position:relative;      width:100px;      margin:50px Auto;      Text-align:center;      Padding:0 2rem;      font-family: ' Arial ', Sans-serif;      font-size:36px;      Line-height:4.5rem;      Color:deeppink;      Background-color:transparent;      BORDER:3PX solid Deeppink;    Cursor:pointer;      }. Btn:after {content: ';      Position:absolute;      Z-index:-1;      top:0;      left:50%;      height:100%;      width:0;      Background-color:deeppink;    Transition:width. 5s, left. 5s;    }. btn:hover {color:white;      }. btn:hover:after {top:0;      left:0;      width:100%;    Transition:width. 5s, left. 5s; }. btn {background-cOlor:deeppink;      Background-image:linear-gradient (white, white);      Background-repeat:no-repeat;      background-size:0% 100%;      Background-position:center;      -webkit-background-clip:text;      -webkit-text-fill-color:transparent;    Transition:background-size. 5s;    }. btn:hover {background-size:100% 100%; } </style></head><body> <div class= "btn" > Btn </div></body></html>

CSS Effects (11)--button fill effect

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: