在HTML中使用占位符属性以显示描述元素期望值的提示。
您可以尝试运行以下代码以实现占位符属性-
<!DOCTYPE html> <html> <body> <h2>Login</h2> <form action = "/new.php"> <input type = "text" placeholder = "Student UserName" name = "name"/><br> <input type = "password" placeholder = "Password" name = "password"> <br><br> <input type = "submit" value = "Submit"> </form> </body> </html>