zoukankan      html  css  js  c++  java
  • button按钮波纹,箭头特效css

    波纹特效:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8"> 
    <title>按钮动画 - 波纹效果</title> 
    <style>
    .button {
        position: relative;
        background-color: #4CAF50;
        border: none;
        font-size: 28px;
        color: #FFFFFF;
        padding: 20px;
        width: 200px;
        text-align: center;
        -webkit-transition-duration: 0.4s; /* Safari */
        transition-duration: 0.4s;
        text-decoration: none;
        overflow: hidden;
        cursor: pointer;
    }
    
    .button:after {
        content: "";
        background: #90EE90;
        display: block;
        position: absolute;
        padding-top: 300%;
        padding-left: 350%;
        margin-left: -20px!important;
        margin-top: -120%;
        opacity: 0;
        transition: all 0.8s
    }
    
    .button:active:after {
        padding: 0;
        margin: 0;
        opacity: 1;
        transition: 0s
    }
    </style>
    </head>
    <body>
    
    <h2>按钮动画 - 波纹效果</h2>
    
    <button class="button">Click Me</button>
    
    </body>
    </html>

    移上去加箭头效果

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8"> 
    <title>加箭头特效</title> 
    <style>
    .button {
      display: inline-block;
      border-radius: 4px;
      background-color: #f4511e;
      border: none;
      color: #FFFFFF;
      text-align: center;
      font-size: 28px;
      padding: 20px;
       200px;
      transition: all 0.5s;
      cursor: pointer;
      margin: 5px;
    }
    
    .button span {
      cursor: pointer;
      display: inline-block;
      position: relative;
      transition: 0.5s;
    }
    
    .button span:after {
      content: '»';
      position: absolute;
      opacity: 0;
      top: 0;
      right: -20px;
      transition: 0.5s;
    }
    
    .button:hover span {
      padding-right: 25px;
    }
    
    .button:hover span:after {
      opacity: 1;
      right: 0;
    }
    </style>
    </head>
    <body>
    
    <h2>按钮动画</h2>
    
    <button class="button" style="vertical-align:middle"><span>Hover </span></button>
    
    </body>
    </html>
    

      

  • 相关阅读:
    test20181024 kun
    test20181020 B君的第二题
    test20181020 B君的第一题
    test20181015 B 君的第三题
    test20181018 B君的第三题
    test20181019 B君的第三题
    test20181021 快速排序
    test20181019 B君的第一题
    test20181018 B君的第一题
    test20181016 B君的第三题
  • 原文地址:https://www.cnblogs.com/z-e-r-o/p/6138153.html
Copyright © 2011-2022 走看看