html - 如何在输入文本占位符中添加 HTML 换行符

标签 html css twitter-bootstrap

<分区>

我想在我的输入文本占位符中添加一个换行符。

<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-

&#10;

例如:

<div class="form-group">
     <textarea class="form-control ph" rows="5" 
     placeholder="Qualification &#10;Education &#10;Background *"></textarea>
</div>

关于html - 如何在输入文本占位符中添加 HTML 换行符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50054870/

上一篇:javascript - 移动 JavaScript 下拉菜单无法打开

下一篇:html - 链接使用两种不同的字体?

相关文章:

html - 如何在 Bootstrap 5 中合并 2 个 DIV 表行

html - bootstrap 4 单击时删除下划线

javascript - Handlebars.js 和 Bootstrap 网格 - 将列换行

css - 无法定位 DIV

javascript - 联系表上的错误

html - css - div 可以溢出它的相对溢出 :hidden container?

html - 协助 html 和 css

jquery - Bootstrap jquery 如何对齐从 jquery 添加的图像

php - preg_match (php) 中的波兰语字母

html - iframe 文本没有出现