CSS3 implementation of the Player play button

Source: Internet
Author: User
Tags rewind

The finished effect is as follows

View effects and download

Step 1: First understand the principle of border:

Step 2:html Code structure

HTML code  
  1. < section class="Playcontainer">
  2. <li class="playbtn">
  3. <a href="#" title="Start">start</a>
  4. </li>
  5. <li class="pausebtn">
  6. <a href="#" title="Pause">pause</a>
  7. </li>
  8. <li class="stopbtn">
  9. <a href="#" title="Stop">stop</a>
  10. </li>
  11. <li class="forwardbtn playbtn">
  12. <a href="#" title="forward">forward</a>
  13. <a href="#" title="forward">forward</a>
  14. </li>
  15. <li class="rewindbtn">
  16. <a href="#" title="Rewind">rewind</a>
  17. <a href="#" title="Rewind">rewind</a>
  18. </li>
  19. <li class="ejectbtn">
  20. <a href="#" class="Arrow">eject</a>
  21. <a href="#" class="Dash">eject</a>
  22. </li>
  23. </Section>

Step 3: Draw Background circle, position:relative

CSS Code  
    1. . playcontainer li {position:relative; float:left; border:25px solid #404040; color: #404040; height: 0; wi DTH:0;-webkit-border-radius: 100%;-moz-border-radius: 100%;-o-border-radius: 100%; Border-radius:  100%; margin: 0 20px;}

Step 4: Draw the Stop button to center the button.

The button is absolutely positioned relative to the outer circle, starting at the center of the circle, so adjust the top and left values

The Stop button has a length of 14px, and the relative origin needs to move up and to the left by 7 pixels, centered.

The full CSS is as follows:

CSS Code  
    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; wi DTH: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. . playbtn a {border-color:transparent transparent transparent #fff; border-width:8px 0 8px 12px;  Width: 0; height: 0;}
    5. . pausebtn a {border-color:transparent white;  Border-width: 0 6px; height:15px; width:6px; left: -9px;}
    6. . stopbtn a {border:7px solid #fff; height: 0; width: 0; Left: -7px; top: -7px;}
    7. . forwardbtn a {border-left-width:8px; left:1px;}
    8. . forwardbtn A:first-child {margin-left: -7px; }
    9. . rewindbtn a {border-width:8px 8px 8px 0; border-color:transparent #fff transparent transparent; width: 0; Heig  HT: 0;}
    10. . rewindbtn A:first-child {margin-left: -7px;}
    11. . ejectbtn A.arrow {border-width: 0 8px 8px 8px; border-color:transparent transparent #fff transparent; top:-26px; le ft:-8px; }  
    12. Ectbtn A.dash {border-width: 0 0 4px; border-color:transparent transparent #fff; height: 0; width:16px; left : -8px; top:4px; }

CSS3 implementation of the Player play button

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.