我正在寻找 bootsrap 中输入的悬停效果代码

I'm looking for the code of the hover effect on input in bootsrap

提问人:LAHCEN AGLAGAL 提问时间:7/28/2022 最后编辑:CrimpLAHCEN AGLAGAL 更新时间:8/31/2022 访问量:32

问:

有人可以告诉我如何使用代码在输入上创建这样的悬停效果,我的意思是 CSS 我不想使用 bootstrap calss :

<div class="form">
  <div class="input-group mb-3">
    <div class="input-group-prepend">
      <span class="input-group-text" id="basic-addon1">@</span>
    </div>
    <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
  </div>

HTML CSS Bootstrap-4 悬停 样式

评论


答:

0赞 Crimp 8/31/2022 #1

您指的是 Bootstrap 输入标签上的类吗?form-control

https://getbootstrap.com/docs/5.0/forms/form-control/

input[type=text]{
  width: 20%;
  padding: 12px 20px;
  margin: 8px 0;
  border-radius: 5px;
  border: solid 1px #c8cacc;
  transition: .04s;
}

input[type=text]:focus{
  outline: solid 4px rgba(95, 160, 250, 0.4);
}
<div class="form">
  <div class="input-group mb-3">
    <div class="input-group-prepend">
      <span class="input-group-text" id="basic-addon1"></span>
    </div>
    <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
  </div>