gpt4 book ai didi

html - 如何设置占位符值的样式,比如如果我想在该值的左侧留出边距,在 css 中要写什么?

转载 作者:太空宇宙 更新时间:2023-11-04 03:10:45 25 4
gpt4 key购买 nike

<html>
<body>
<div class="user_name floatleft fix">
<input placeholder="User name" type="text"/>
</div>
</body>
</html>

我想在输入的“用户名”左边留一些边距。请帮忙。

最佳答案

输入填充Demo

input{
padding-left: 5px;
}

如果您想要更具体并且不影响 HTML 中的所有输入。你可以这样做:

.user_name > input {
padding-left: 5px;
}

关于html - 如何设置占位符值的样式,比如如果我想在该值的左侧留出边距,在 css 中要写什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29567621/

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