<分区>
<分区>
我想在我的输入文本占位符中添加一个换行符。
<div class="form-group">
<input type="text" class="form-control ph" id="" placeholder="Qualification Education Background *">
</div>
我试过
<div class="form-group">
<input type="text" class="form-control ph" id="" placeholder="Qualification\n</br> Education\n <br>Background *">
</div>
但它不起作用。有人能帮我实现这个目标吗?
最佳答案
输入不能超过一行,所以如果你想让输入多行使用textarea。要在文本区域的占位符中换行,请使用 html entity-
例如:
<div class="form-group">
<textarea class="form-control ph" rows="5"
placeholder="Qualification Education Background *"></textarea>
</div>
关于html - 如何在输入文本占位符中添加 HTML 换行符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50054870/