gpt4 book ai didi

html - 占位符在输入字段内自动换行

转载 作者:太空狗 更新时间:2023-10-29 13:40:48 25 4
gpt4 key购买 nike

我需要在输入字段中放置一个长的 placeholder 文本。

但是,placeholder 会因为其较长的文本而被截断。

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<label for="password">
<input id="password" name="user[password]" placeholder="Password (at least 8 letters, numbers, or punctuation marks)" size="30" type="password">
</label>

有什么办法可以让它变成这样吗? enter image description here

最佳答案

input{
height:50px;
}

::-webkit-input-placeholder { /* Chrome/Opera/Safari */
white-space:pre-line;
position:relative;
top:-7px;

}
::-moz-placeholder { /* Firefox 19+ */
white-space:pre-line;
position:relative;
top:-7px;
}
:-ms-input-placeholder { /* IE 10+ */
white-space:pre-line;
position:relative;
top:-7px;
}
:-moz-placeholder { /* Firefox 18- */
white-space:pre-line;
position:relative;
top:-7px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<label for="password">
<input id="password" name="user[password]" placeholder="Password (at least 8 letters, numbers, or punctuation marks)" size="30" type="password">
</label>

关于html - 占位符在输入字段内自动换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39761030/

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