其他分享
首页 > 其他分享> > [CSS] transform-origin: change the way of element's transformations

[CSS] transform-origin: change the way of element's transformations

作者:互联网

For example, a checkbox mark, if we show / hide by:

transform: scale(0);

by default it shows up from center, we want it from "bottom left", we can do:

.checkbox {
  .input__control {
      border-radius: var(--border-radius);
  }

  .input__control svg {
      width: 0.65em;
      transform: scale(0);
      transition: 120ms transform ease-in-out;
      transform-origin: bottom left;
  }

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

 

标签:origin,__,scale,transformations,transform,control,input
来源: https://www.cnblogs.com/Answer1215/p/14488699.html