CSS를 사용하여 자리 표시자 속성의 색상을 변경하려면 코드는 다음과 같습니다. -
예시
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 20px;
}
input {
font-size: 40px;
font-weight: bold;
}
::placeholder {
color: rgb(70, 53, 167);
}
:-ms-input-placeholder {
color: rgb(66, 51, 155);
}
::-ms-input-placeholder {
color: rgb(122, 69, 182);
}
</style>
</head>
<body>
<h1>Placeholder color change example</h1>
<input type="text" placeholder="Some placeholder text" />
</body>
</html> 출력
위의 코드는 다음과 같은 출력을 생성합니다 -
