菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
85
0

[CSS] Using transform: scale(0) for hiding element

原创
05/13 14:22
阅读数 305083

标签:cte   play   splay   check   sel   radio   ansi   NPU   button   

For a radio button control, when hide selected status, we can use:

      .input__control::before {
          content: "";
          width: 0.5em;
          height: 0.5em;
          // box-shadow works better than background-color on printable version
          box-shadow: inset 1em 1em var(--color-primary, color("primary"));
          border-radius: 50%;
          // using as display none
          transform: scale(0);
          transition: 180ms transform ease-in-out;
      }

      input:checked + .input__control::before {
        transform: scale(1);
      }

It is easy to apply animation to it as well.

[CSS] Using transform: scale(0) for hiding element

发表评论

0/200
85 点赞
0 评论
收藏
为你推荐 换一批