CSS3实现的player播放按钮_html/css_WEB-ITnose

php中文网
发布: 2016-06-24 11:59:15
原创
1763人浏览过

完成的效果如下

 

立即学习前端免费学习笔记(深入)”;

查看效果并下载

 

立即学习前端免费学习笔记(深入)”;

Step 1:先了解border的原理:

 

立即学习前端免费学习笔记(深入)”;

 

立即学习前端免费学习笔记(深入)”;

Step 2:HTML代码结构

 

立即学习前端免费学习笔记(深入)”;

Html代码   

  1.   
  2.    
  3.   
  4.     Start  
  5.   
  6.   
  7.    
  8.   
  9.     Pause  
  10.   
  11.   
  12.    
  13.   
  14.     Stop  
  15.   
  16.   
  17.    
  18.   
  19.     Forward  
  20.     Forward  
  21.   
  22.   
  23.    
  24.   
  25.     Rewind  
  26.     Rewind  
  27.   
  28.   
  29.   
  30.   
  31.     Eject  
  32.     Eject  
  33.   
  34.   
  35.   

 

立即学习前端免费学习笔记(深入)”;

 

立即学习前端免费学习笔记(深入)”;

Step 3:画背景圆,position:relative

 

立即学习前端免费学习笔记(深入)”;

 

立即学习前端免费学习笔记(深入)”;

Css代码   

  1. .playContainer li { position: relative; float: left; border: 25px solid #404040; color: #404040; height: 0; width:0; -webkit-border-radius: 100%; -moz-border-radius: 100%; -o-border-radius: 100%; border-radius: 100%; margin: 0 20px; }  

 

立即学习前端免费学习笔记(深入)”;

 

立即学习前端免费学习笔记(深入)”;

 

立即学习前端免费学习笔记(深入)”;

 

立即学习前端免费学习笔记(深入)”;

Step 4:画stop按钮,要让按钮居中。

 

立即学习前端免费学习笔记(深入)”;

按钮相对外层圆圈绝对定位,从圆圈的中心开始,所以要调整top和left值

 

立即学习前端免费学习笔记(深入)”;

stop按钮边长14px,相对原点需要向上、向左移动7个像素,居中。

 

立即学习前端免费学习笔记(深入)”;

全部的CSS如下:

 

立即学习前端免费学习笔记(深入)”;

 

立即学习前端免费学习笔记(深入)”;

Css代码   

    1.    .playContainer { position: relative; float: left; background: rgba(0, 0, 0, 0.8); padding: 20px; }  
    2. .playContainer li { position: relative; float: left; border: 25px solid #404040; color: #404040; height: 0; width:0; -webkit-border-radius: 100%; -moz-border-radius: 100%; -o-border-radius: 100%; border-radius: 100%; margin: 0 20px; }  
    3. .playContainer a { border-style: solid; text-indent: -9999px; position: absolute; top: -8px; left: -3px;  }  
    4.   
    5. .playBtn a { border-color: transparent transparent transparent #fff; border-width: 8px 0 8px 12px;  width: 0; height: 0; }  
    6. .pauseBtn a { border-color: transparent white;  border-width: 0 6px; height: 15px; width: 6px; left: -9px; }  
    7. .stopBtn a { border: 7px solid #fff; height: 0; width: 0; left: -7px; top: -7px;}  
    8. .forwardBtn a { border-left-width: 8px; left: 1px; }  
    9. .forwardBtn a:first-child { margin-left: -7px;  }  
    10.   
    11. .rewindBtn a { border-width: 8px 8px 8px 0; border-color: transparent #fff transparent transparent; width: 0; height: 0; }  
    12. .rewindBtn a:first-child { margin-left: -7px; }  
    13.   
    14. .ejectBtn a.arrow { border-width: 0 8px 8px 8px; border-color: transparent transparent #fff transparent; top:-26px; left:-8px; }  
    15. ectBtn a.dash { border-width: 0 0 4px; border-color: transparent transparent #fff; height: 0; width:16px; left: -8px; top: 4px; } 

HTML速学教程(入门课程)
HTML速学教程(入门课程)

HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号