发现一个有趣的东西,就是使用纯CSS代码实现打字机的效果。所谓的打字机效果就是控制一个字符串字符,并且字符串中的每个一个字符一个接着一个的出现。纯CSS实现文字的打印机效果,要用到 animation
2021-11-06 16:47:16
249
闲着没事写了一个利用CSS代码实现对号与叉号的效果,下面放个代码出来,方便以后自己使用!
CSS代码实现对号与叉号的效果代码html示例代码:
<!DOCTYPE html> <html> <head> <style> /*对号CSS*/ .success{ display: inline-block; font-weight: 700; width: 8px; height: 13px; transform: rotate(45deg); border-style: solid; border-color: #009933; border-width: 0 4px 4px 0 ; } /*叉号CSS*/ .error { width: 15px; height: 15px; position: relative; margin-left: 10px; } .error::before, .error::after { content: ""; position: absolute; height: 18px; width: 3px; top: 0px; right: 15px; background: red; } .error::before { transform: rotate(45deg); } .error::after { transform: rotate(-45deg); } </style> </head> <body> <div class="success"></div> <br/><br/> <div class="error"></div> </body> </html>
示例效果:
16
2022-09
16
2022-09
16
2022-09
14
2022-09
13
2022-09
03
2022-09