Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
您可以尝试在表单元素中使用 fieldset。
<fieldset> <legend> <label for="username">Username</label> </legend> <input type="text" id="username" name="username"> </fieldset>
之后,您可以尝试在 css 中编辑样式。可能是为了去掉输入的边框并更改框的宽度。
You can try to use fieldset in your form element.
After that, you can try to edit your styling in your css. Probably to take out the border of the input and change the width of the box.
使用 :before 进行基本演示。
:before
input { border: transparent; text-align: left; } input::placeholder { text-align: center; } input:focus { outline: transparent; } .line { border: 1px solid black; border-radius: 5px; width: fit-content; padding: 10px 0px 5px 0px; } .line:before { content: "username"; position: absolute; top: 0; left: 20px; background-color: white; padding: 0 2px; }
<div class="line"> <input type="text" placeholder="[email protected]"> </div>
Basic demonstration using :before.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(2)
您可以尝试在表单元素中使用 fieldset。
之后,您可以尝试在 css 中编辑样式。可能是为了去掉输入的边框并更改框的宽度。
You can try to use fieldset in your form element.
After that, you can try to edit your styling in your css. Probably to take out the border of the input and change the width of the box.
使用
:before
进行基本演示。Basic demonstration using
:before
.