Modify the css style of the placeholder font

【Foreword】

    This article summarizes the CSS style of modifying the placeholder font

    Implementation method---implemented by pseudo-class

【main body】

(1) Modify the css style of the text in the palmeholder

 

::-webkit-input-placeholder{
     color: red;
     font-size: 20px;
     line-height: 50px;
 }

 

(2) Modify the css style of the text in the palmholder of the element whose class name is test1

 

.test1::-webkit-input-placeholder{
    color: red;
    font-size: 20px;
    line-height: 50px;
}

(3) Effect drawing:

 

 

   For compatibility, add the corresponding browser prefix

(4) Browser compatible writing

               /*-webkit-placeholer:red;*/
		::-webkit-input-placeholder { /* WebKit browsers */  
		    color:#c50000;  
		}  
		:-moz-placeholder { /* Mozilla Firefox 4 to 18 */  
		    color:#c50000;opacity:1  
		}  
		::-moz-placeholder { /* Mozilla Firefox 19+ */  
		    color:#c50000;opacity:1  
		}  
		:-ms-input-placeholder { /* Internet Explorer 10+ */  
		    color:#c50000;  
		}  

 

 

 

 

 

 

 

 

.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326072824&siteId=291194637