zoukankan      html  css  js  c++  java
  • input的placeholder文字右对齐的方法

    如果你不考虑移动端的话,完全可以使用text-align:right;

    如果考虑移动端的话,在一些手机上,即使你写了text-align:right,placeholder也是左对齐的,经过我的验证,这个方法完美无缺,css代码如下:

    ::-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;
    }
  • 相关阅读:
    css优化总结
    几种常用的图片格式
    css布局总结
    第四章复习题
    4.9,4.10
    4.8
    4.7指针
    libffi
    代理模式
    Redis 汇总
  • 原文地址:https://www.cnblogs.com/ZhaoWeiNotes/p/13490421.html
Copyright © 2011-2022 走看看