效果图
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>修改input标签中默认文字的样式</title>
<style>
input {
width: 150px;
height: 30px;
}
/* 修改placeholder的样式 */
input::placeholder {
padding: 0 5px;
color: #f00;
}
</style>
</head>
<body>
<input type="text" placeholder="请输入文字">
</body>
</html>