Html <code> with placeholder

时间:2015-06-25 09:56:50

标签: html css haml

How I need add placeholder attribute to < code> < /code> tag like in < input> < /input>?

<input type="text" name="fname" placeholder="First name"><br>

1 个答案:

答案 0 :(得分:1)

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

Example showing the difference here