我目前正在构建一个网站,并且遇到了transform: scale. 我有一个按钮,当用户将鼠标悬停在它上面时,会发生两件事:
我已经开始工作了,它看起来非常好,但是在实施第3点之后,当按钮增大时,我看到左侧有一个奇怪的间隙。
这是我的代码:点击演示
<a href="#" class="button">Hover</a>
Run Code Online (Sandbox Code Playgroud)
body {
text-align: center;
padding-top: 10%;
}
.button {
display: inline-block;
text-transform: uppercase;
font-size: 1.1em;
font-weight: 600;
background: transparent;
transition: all ease .25s;
border: 3px solid green;
color: green;
position: relative;
overflow: hidden;
z-index: 2;
font-family: sans-serif;
padding: 20px 35px;
text-decoration: none;
}
.button:before {
content: ' ';
transition: all ease-out .25s;
width: 200%;
height: 100%;
position: absolute;
top: 0;
left: 0; …Run Code Online (Sandbox Code Playgroud)