如何将文本移入按钮内,只有在我单击文本而不是单击按钮时才移动?参考。 (.button_text,.button_icon)
.button__text {
position:relative;
transform:translate3d(0px, -4px, 0px);
margin:0;
align-self:end;
grid-column:1/5;
grid-row:2;
text-align:center;
font-size: 32px;
font-weight:550;
background-color: #aaaa;
color: transparent;
font-family: 'Nunito', sans-serif;
-webkit-background-clip: text;
-moz-background-clip: text;
background-clip: text;
transition: .13s ease-in-out;
}
.button__text:active {
transform:translate3d(0px, 0px, 0px);
}
.button__text {
position:relative;
transform:translate3d(0px, -4px, 0px);
margin:0;
align-self:end;
grid-column:1/5;
grid-row:2;
text-align:center;
font-size: 32px;
font-weight:550;
background-color: #aaaa;
color: transparent;
font-family: 'Nunito', sans-serif;
-webkit-background-clip: text;
-moz-background-clip: text;
background-clip: text;
transition: .13s ease-in-out;
}
.button__text:active {
transform:translate3d(0px, 0px, 0px);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要感觉到何时单击按钮,然后更改文本的翻译。
这是一个简单的片段 - 当按钮具有:活动时,其孩子会得到更改的定位。
You need to sense when the button has been clicked and then alter the translation of the text.
Here's a simple snippet - when the button has :active then its child gets the altered positioning.