HTML5 textarea placeholder not appearing

后端 未结 9 1830
佛祖请我去吃肉
佛祖请我去吃肉 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:30

    I know this post has been (very well) answered by Aquarelle but just in case somebody is having this issue with other tag forms with no text such as inputs i'll leave this here:

    If you have an input in your form and placeholder is not showing because a white space at the beginning, this may be caused for you "value" attribute. In case you are using variables to fill the value of an input check that there are no white spaces between the commas and the variables.

    example using twig for php framework symfony :

           <-- this is ok
          <-- this will not show placeholder 
    

    In this case the tag between {{ }} is the variable, just make sure you are not leaving spaces between the commas because white space is also a valid character.

提交回复
热议问题