HTML5 textarea placeholder not appearing

后端 未结 9 1828
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 16:02

I cannot figure out what is wrong with my markup, but the placeholder for the text area will not appear. It seems as though it may be covered up with some blank spaces and t

9条回答
  •  渐次进展
    2020-11-29 16:44

    This one has always been a gotcha for me and many others. In short, the opening and closing tags for the

    Bad:

    
    

    Update (2020)

    This is not true anymore, according to the HTML5 parsing spec:

    If the next token is a U+000A LINE FEED (LF) character token, 
    then ignore that token and move on to the next one. (Newlines 
    at the start of textarea elements are ignored as an authoring 
    convenience.)
    

    You might still have trouble if you editor insists on ending lines with CRLF, though.

提交回复
热议问题