更改 w3 中动画输入的宽度 css

Change the width of animated input in w3 css

我使用了来自 W3 CSS 的动画输入。我点击它时占100%的宽度,但我只想让它在我点击时占75%的宽度。

密码是:

<input class="w3-input w3-border w3-animate-input" type="text" style="width:30%">

您尝试更改的 属性 由 伪 class 控制。您需要更改 w3-animate-input:focus {width:75%;} 的宽度。您必须将此添加到您的代码中。您可以将其添加到

  • <script> 标记之间的页面头部部分。
  • w3.css 文件,如果您将其托管在您的网站上。