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
- < section class="Playcontainer">
- <li class="playbtn">
- <a href="#" title="Start">start</a>
- </li>
- <li class="pausebtn">
- <a href="#" title="Pause">pause</a>
- </li>
- <li class="stopbtn">
- <a href="#" title="Stop">stop</a>
- </li>
- <li class="forwardbtn playbtn">
- <a href="#" title="forward">forward</a>
- <a href="#" title="forward">forward</a>
- </li>
- <li class="rewindbtn">
- <a href="#" title="Rewind">rewind</a>
- <a href="#" title="Rewind">rewind</a>
- </li>
- <li class="ejectbtn">
- <a href="#" class="Arrow">eject</a>
- <a href="#" class="Dash">eject</a>
- </li>
- </Section>
Step 3: Draw Background circle, position:relative
CSS Code
- . 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
- . playcontainer {position:relative; float:left; Background:rgba (0, 0, 0, 0.8); padding:20px;}
- . 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;}
- . playcontainer a {border-style:solid; Text-indent: -9999px; position:absolute; top: -8px; left: -3px; }
- . playbtn a {border-color:transparent transparent transparent #fff; border-width:8px 0 8px 12px; Width: 0; height: 0;}
- . pausebtn a {border-color:transparent white; Border-width: 0 6px; height:15px; width:6px; left: -9px;}
- . stopbtn a {border:7px solid #fff; height: 0; width: 0; Left: -7px; top: -7px;}
- . forwardbtn a {border-left-width:8px; left:1px;}
- . forwardbtn A:first-child {margin-left: -7px; }
- . rewindbtn a {border-width:8px 8px 8px 0; border-color:transparent #fff transparent transparent; width: 0; Heig HT: 0;}
- . rewindbtn A:first-child {margin-left: -7px;}
- . ejectbtn A.arrow {border-width: 0 8px 8px 8px; border-color:transparent transparent #fff transparent; top:-26px; le ft:-8px; }
- 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