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;
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM