简体   繁体   English

将className添加到:: - webkit

[英]Add a className to ::-webkit

I am trying to add a classname into webkit, moz, ms... How can I convert it: 我正在尝试将一个类名添加到webkit,moz,ms ...我该如何转换它:

::-webkit-input-placeholder {
    text-align: center;
}

::-moz-placeholder { 
    text-align: center; 
}

::-ms-input-placeholder { 
    text-align: center;
}

into: 成:

.form-horizontal {

::-webkit-input-placeholder {
    text-align: center;
}

::-moz-placeholder { 
    text-align: center; 
}

::-ms-input-placeholder { 
    text-align: center;
}

}

Thank you. 谢谢。

You just put the class name you want in front of the selector. 您只需将所需的类名放在选择器前面。 If you want to nest your selectors like that, use a preprocessor. 如果要嵌套这样的选择器,请使用预处理器。

 .form-horizontal ::-webkit-input-placeholder { text-align: center; } .form-horizontal ::-moz-placeholder { text-align: center; } .form-horizontal ::-ms-input-placeholder { text-align: center; } 
 <div class="form-horizontal"> <input type="text" placeholder="centered"> </div> <div> <input type="text" placeholder="non centered"> </div> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM