HTML5 placeholder attribute: Chrome doesn't line-wrap in textareas

允我心安 提交于 2019-12-08 06:19:20

问题


I'm trying to use a couple of these newfangled HTML5 form attributes, and the placeholder attribute seemed to be a good match to get the magic going.

It works pretty good, but Chrome insists to present the whole placeholder text on one line if the textarea is to small. Other browsers like Firefox or rekonq (the only other WebKit browser that I have at my disposal ATM) line-wrap the text.

While the spec talks about linefeeds being forbidden in the placeholder attribute, it says nothing against line wrapping. Is this just something that is for the implementor to decide, is it a Chrome bug, or are the other browsers mistaken?

And, most importantly of course, is there a workaround?


回答1:


I've filed this as a webkit bug

Next time feel free to do the same. :)

As for a workaround you can try out this and force it to fail feature detection in webkit somehow.



来源:https://stackoverflow.com/questions/4461414/html5-placeholder-attribute-chrome-doesnt-line-wrap-in-textareas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!