::প্লেসহোল্ডার সিউডো-এলিমেন্ট ব্যবহার করে, আমরা টেক্সটবক্সের জন্য স্থানধারক পাঠ্যের রঙ পরিবর্তন করতে পারি।
CSS ::placeholder pseudo-element-এর সিনট্যাক্স নিম্নরূপ -
::placeholder {
attribute: /*value*/
} উদাহরণ
নিম্নলিখিত উদাহরণগুলি CSS ::স্থানধারক সিউডো-এলিমেন্টকে চিত্রিত করে।
<!DOCTYPE html>
<html>
<head>
<style>
input:last-child::placeholder {
color: cornflowerblue;
}
</style>
</head>
<body>
<input type="text" placeholder="Default color" />
<input type="text" placeholder="Check my new color :D" />
</body>
</html> আউটপুট
এটি নিম্নলিখিত ফলাফল তৈরি করবে -

উদাহরণ
<!DOCTYPE html>
<html>
<head>
<style>
input::placeholder {
color: fuchsia;
}
input {
margin: 2%;
width: 100%;
}
div {
display: flex;
flex-direction: column;
margin: 3%;
padding: 3%;
text-align: center;
align-items: center;
box-shadow: inset 0 0 30px brown;
}
button {
width: 40%;
}
</style>
</head>
<body>
<div>
<input type="text" placeholder="Normal placeholder" />
<input type="email" placeholder="somenone@somewhere.com" />
<button>dummy btn</button>
</div>
</body>
</html> আউটপুট
এটি নিম্নলিখিত ফলাফল তৈরি করবে -
