Html <code> 带占位符

Html <code> with placeholder

我如何需要将 placeholder 属性添加到 </code></strong> 标记,如 <strong><input> </input></strong>?</p> <pre><code><input type="text" name="fname" placeholder="First name"><br>

您不能在 <code></code> 中使用占位符,因为它不是输入字段...您可能想使用 <textarea placeholder="your placeholder"></textarea> 来输入代码...

Example showing the difference here