CSS样式打勾
作者:互联网
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style type="text/css"> /**绿色勾*/ .checked { display: inline-block; position: relative; width: 15px; height: 15px; border-radius: 50%; background-color: #2ac845; } /**灰色勾*/ .uncheck { display: inline-block; position: relative; width: 15px; height: 15px; border-radius: 50%; background-color: #5f646e; } .checked:before, .checked:after, .uncheck:before, .uncheck:after { content: ''; pointer-events: none; position: absolute; color: white; border: 1px solid; background-color: white; } .checked:before, .uncheck:before { width: 1px; height: 1px; left: 25%; top: 50%; transform: skew(0deg,50deg); } .checked:after, .uncheck:after { width: 3px; height: 1px; left: 45%; top: 42%; transform: skew(0deg,-50deg); } .feature { width: 14px; height: 6px; display: inline-block; border: 1px solid black; border-width: 0 0 1px 1px; transform: rotate(-45deg); -ms-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -webkit-transform: rotate(-45deg); -o-transform: rotate(-45deg); vertical-align: baseline; } div { width: 100px; height: 100px; position: absolute; left: 50%; top: 50%; margin: -50px 0 0 -50px; } </style> </head> <body> <span class="checked"></span><br /> <span class="uncheck"></span><br /> <span class="feature"></span> </body> </html>
标签:checked,打勾,样式,transform,height,width,1px,border,CSS 来源: https://www.cnblogs.com/ronle/p/16669564.html