placeholder右对齐的写法,兼容性比较高的一种方法

placeholder右对齐的写法,如果你不考虑移动端的话,完全可以使用text-align:right,不过如果考虑移动端的话,在有一些手机上,即使你写了text-align:right,placeholder也是左对齐的,经过百度后得出,http://stackoverflow.com/questions/6729837/text-align-right-only-for-placeholder,经过我的验证,这个方法完美无缺,特记录在册,以备后用!!!

::-webkit-input-placeholder { /* WebKit browsers */
    direction: rtl;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
    direction: rtl;
}
::-moz-placeholder { /* Mozilla Firefox 19+ but I'm not sure about working */
    direction: rtl;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
    direction: rtl;
}
posted @ 2016-06-22 18:24  王子秦  阅读(4323)  评论(0编辑  收藏  举报