Placeholder style customization (uniapp WeChat applet, h5)

1. Use uniapp to develop
① The first way: (write in line)

<input type="text" placeholder="姓名" placeholder-style="font-size:28rpx;color:#999999;" />

②Second method:
(add the placeholder-class attribute to the input, then set a class name for the attribute, and set the style in style.)

<input  type="text"  placeholder="地址" placeholder-class="address"/>
 
 <style>
 	.address{
    
    
		color: red;
	}
 </style>


2. Use H5 to develop

<input type="text" placeholder="请输入搜索内容" />

<style>
/*修改提示字的颜色*/
input::-webkit-input-placeholder {
    
     /* WebKit browsers */ 
color:green; 
}
input:-moz-placeholder {
    
     /* Mozilla Firefox 4 to 18 */ 
color:green
}
input::-moz-placeholder {
    
     /* Mozilla Firefox 19+ */ 
color:green
}
input:-ms-input-placeholder {
    
     /* Internet Explorer 10+ */ 
color:green
}
</style>

Guess you like

Origin blog.csdn.net/maoge_666/article/details/131890314