zoukankan      html  css  js  c++  java
  • Css transition

    CSS的transition允许CSS的属性值在一定的时间区间内平滑地过渡。这种效果可以在鼠标单击、获得焦点、被点击或对元素任何改变中触发,并圆滑地以动画效果改变CSS的属性值。

    <!DOCTYPE html>
    <html>
    <head>
    <style> 
    div
    {
    width:100px;
    height:100px;
    background:blue;
    transition:width 2s;
    -moz-transition:width 2s; /* Firefox 4 */
    -webkit-transition:width 2s; /* Safari and Chrome */
    -o-transition:width 2s; /* Opera */
    }
    
    div:hover
    {
    width:300px;
    }
    </style>
    </head>
    <body>
    
    <div></div>
    
    <p>请把鼠标指针移动到蓝色的 div 元素上,就可以看到过渡效果。</p>
    
    <p><b>注释:</b>本例在 Internet Explorer 中无效。</p>
    
    </body>
    </html>

    当鼠标放上去 长度平滑到300px

  • 相关阅读:
    LabVIEW入门第三天(软件及驱动包下载)
    poj1732
    poj1722
    poj1821
    poj1770
    poj1949
    poj1726
    poj1699
    poj1682
    poj1853
  • 原文地址:https://www.cnblogs.com/nele/p/4995409.html
Copyright © 2011-2022 走看看