gpt4 book ai didi

html - 在表单输入中添加带边框的字体图标

转载 作者:行者123 更新时间:2023-11-28 05:17:46 24 4
gpt4 key购买 nike

有什么办法可以达到这样的效果:

enter image description here

我已经尝试了我在堆栈中找到的选项(使用 span),但即使我让它工作,我也无法从图标右侧执行白线,有人可以帮助我吗?

我当前的代码如下所示:

                    <form>
<input type="text" name="firstname" placeholder="Name">
<input type="text" name="firstname" placeholder="e-mail">
<input type="text" name="firstname" placeholder="website">
</form>

我还尝试在带有边框的容器中添加该图标以达到效果:

<form>
<span class="form_frame"><i class="fa fa-user-circle-o" aria-hidden="true"></i>
</span>
<input type="text" name="firstname" placeholder="Name">

和CSS:

.form_frame {
height: 60px;
border-width: 1px solid;
border-color: white;
width: 100%;
background-color: #2b2b2b;

但没有成功

感谢您的帮助。

最佳答案

在跨度内添加图标和输入。然后,如果需要,您可以为整个跨度添加边框,我们可以只在图标或输入框上添加边框。

.fa-address-book-o {
border: solid;
border-color: red;
}
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<span><i class="fa fa-address-book-o" aria-hidden="true"></i><input type="text"/></span>

关于html - 在表单输入中添加带边框的字体图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42999371/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com