简体   繁体   English

使用CSS3旋转选项卡中的图像/图标旋转

[英]Image/Icon Rotation in a Tab using CSS3 Rotation

I wanted to create a Metro Style Website and want to add Buttons like in the following : 我想创建一个Metro Style网站,并希望添加如下所示的Button:

http://themeforest.net/item/metro-lab-responsive-metro-dashboard-template/full_screen_preview/5359122 http://themeforest.net/item/metro-lab-sensitive-metro-dashboard-template/full_screen_preview/5359122

When we hover over the 'New User', 'Sales' etc Tabs, the icons/Images in the tabs rotates, increases its size and looses opacity. 当我们将鼠标悬停在“新用户”,“销售”等选项卡上时,选项卡中的图标/图像会旋转,增加其大小并失去不透明度。

But I am not able to get the exact output. 但是我无法获得确切的输出。

You can see where I had reached at : 您可以在看到我到达的地方:

http://developer.nuevothoughts.com/jiteen/attendance/docs/# http://developer.nuevothoughts.com/jiteen/attendance/docs/#

I would appreciate any kind of Help in this. 我将不胜感激。

You need to use transition timings... 您需要使用过渡时间...

transition: all 0.5s ease-in-out 0s;
-moz-transition: all 0.5s ease-in-out 0s;
-webkit-transition: all 0.5s ease-in-out 0s;
-o-transition: all 0.5s ease-in-out 0s;

The above is the CSS applied to the example site you gave. 上面是应用于您提供的示例网站的CSS。

Try this 尝试这个

.icon-rocket{
    -webkit-transition-duration: 0.8s;
    -moz-transition-duration: 0.8s;
    -o-transition-duration: 0.8s;
    transition-duration: 0.8s;

    -webkit-transition-property: -webkit-transform;
    -moz-transition-property: -moz-transform;
    -o-transition-property: -o-transform;
    transition-property: transform;

    overflow:hidden;

    }  

.icon-rocket:hover  
{
    -webkit-transform:rotate(360deg);
    -moz-transform:rotate(360deg);
    -o-transform:rotate(360deg);
}  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM