HTML5 placeholder css padding

后端 未结 14 1783
失恋的感觉
失恋的感觉 2020-12-04 06:49

I\'ve seen this post already and tried everything I could to change the padding for my placeholder but alas, it seems it just doesn\'t want to cooperate.

Anyway, her

14条回答
  •  没有蜡笔的小新
    2020-12-04 07:14

    Removing the line-height indeed makes your text align with your placeholder-text, but it doesn't properly solve your problem since you need to adapt your design to this flaw (it's not a bug). Adding vertical-align won't do the deal either. I haven't tried in all browsers, but it doesn't work in Safari 5.1.4 for sure.

    I have heard of a jQuery fix for this, that is not cross-browser placeholder support (jQuery.placeholder), but for styling placeholders, but I haven't found it yet.

    In the meantime, you can resolve to the table on this page which shows different browser support for different styles.

    Edit: Found the plugin! jquery.placeholder.min.js provides you with both full styling capabilities and cross-browser support into the bargain.

提交回复
热议问题