Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

css按钮无限循环缩放 #33

Open
zhn4 opened this issue Mar 18, 2018 · 0 comments
Open

css按钮无限循环缩放 #33

zhn4 opened this issue Mar 18, 2018 · 0 comments
Labels

Comments

@zhn4
Copy link
Owner

zhn4 commented Mar 18, 2018

面试遇到一个按钮无限循环缩放问题,记录一下

参考:https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes
demo:http://jsbin.com/dadopihala/edit?html,css,output

<div class="box">123</div>
@keyframes shensuo {
  from {
    width: 20px
    height: 20px;
  }
  to {
    width: 200px;
    height: 200px;
  }
}

.box {
  border: 1px solid red;
  width: 40px;
  height: 40px;
  animation: shensuo 1.5s infinite linear;
}

另一个sale的方法
demo:http://jsbin.com/pajojoyeqi/edit?html,css,output

<div class="box">123</div>
@keyframes suofang {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(2);
  }
}

.box {
  width: 40px;
  height: 40px;
  border: 1px solid red;
  animation: suofang 1s infinite linear;
}
@zhn4 zhn4 changed the title css按钮无限缩放 css按钮无限循环缩放 Mar 19, 2018
@zhn4 zhn4 added the css label Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant