placeholder padding css code example

Example 1: how to margin placeholdr text

input[type="text"]::placeholder {  
                  
                /* Firefox, Chrome, Opera */ 
                padding-left: 10px; 
            } 
/*Must include type="text" in HTML*/

Example 2: html css placeholder input font-size

Placeholder text will automatically inherit the font family and font size of the regular input text, but you may be in a situation where you want to change the placeholder text color. You can accomplish that with the ::placeholder pseudo-element.

Tags:

Html Example