<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content="Mu Renzi Wei Yichen"> <title>Modify the style of the input attribute placeholder</title> <style> #canChange::-webkit-input-placeholder{ color:red; font-size:2em; } </style> </head> <body> <input type="text" placeholder="I can change"> <input type="text" placeholder="I can change" id="canChange"> </body> </html>
Whether the browser supports it, adding a prefix is, for example, webkit is a browser with webkit kernel, ms is a browser with ms kernel