自定义复选框 记住密码之类可以使用

太过爱你忘了你带给我的痛 2022-10-20 14:58 132阅读 0赞

自定义复选框 记住密码之类可以使用

最终样式:
在这里插入图片描述

html部分

  1. <input type="checkbox" name="" id="autoLogin">
  2. <label for="autoLogin"></label>

css部分

  1. label {
  2. width: .875rem;
  3. height: .875rem;
  4. border: 1px solid #3A88F7;
  5. display: inline-block;
  6. border-radius: 50%;
  7. position: relative;
  8. top: 3px;
  9. margin-right: 10px;
  10. }
  11. input[type="checkbox"] {
  12. display: none;
  13. }
  14. input:checked+label {
  15. text-align: center;
  16. line-height: 20px;
  17. background: #3A88F7;
  18. position: relative;
  19. top: 3px;
  20. margin-right: 10px;
  21. }
  22. input:checked+label::after {
  23. content: "\2714";
  24. color: #fff;
  25. position: relative;
  26. top: -3px;
  27. font-size: 9px;
  28. }

发表评论

表情:
评论列表 (有 0 条评论,132人围观)

还没有评论,来说两句吧...

相关阅读

    相关 定义兼容IE8的

    最近写页面又用到了自定义单选框,复选框,之前也有写过,但是没有做记录,这一次又重新写,用了不短的时间,想想还是记录一下,留待后用。 复选框 HTML <div c