|
发表于 2017-5-8 11:35:42
|
显示全部楼层
交作业
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>图标元素</title>
- <style type="text/css">
- @font-face {
- font-family: 'flat-ui-pro-icons';
- src: url('fonts/icons.ttf'), url('fonts/icons.eot'), url('fonts/icons.woff'), url('fonts/icons.svg');
- }
- .icon::before{
- content: "\e65f";
- font-family: 'flat-ui-pro-icons';
- font-size: 66px;
- display: block;
- }
- .icon{
- font-size: 0; /*通过font-size为0px,隐藏文字,这是一个很实用的小技巧。*/
- cursor: pointer; /*cursor 属性规定要显示的光标的类型(形状)。
- 该属性定义了鼠标指针放在一个元素边界范围内时所用的光标形状;
- pointer 光标呈现为指示链接的指针(一只手)*/
- display: block;
- width: 111px;
- height: 111px;
- line-height: 111px;
- border-radius: 50%;
- background-color: #000;
- color:#00DD00;
- text-align: center;
- }
- /*.icon:hover::before{
- transform: rotate(360deg);
- transition: transform 1s linear;
- }*/
- @keyframes Animation{
- from{
- transform: rotate(0deg);
- }
- to{
- transform: rotate(360deg);
- }
- }
- .icon:hover::before{
- animation:Animation 1s linear 0.8s 4 alternate;
- /*animation 属性是一个简写属性,用于设置六个动画属性:
- animation-name 规定需要绑定到选择器的 keyframe 名称。。
- animation-duration 规定完成动画所花费的时间,以秒或毫秒计。
- animation-timing-function 规定动画的速度曲线。
- animation-delay 规定在动画开始之前的延迟。
- animation-iteration-count 规定动画应该播放的次数。
- animation-direction 规定是否应该轮流反向播放动画。
- 请始终规定 animation-duration 属性,否则时长为 0,就不会播放动画了。
- */
- }
- </style>
- </head>
- <body>
- <div class="icon">icon</div>
- </body>
- </html>
复制代码 |
-
|