Hi all,
While designing a form in html with CSS3, I came across a situation where I have to set the color of asterix sign which was a part of placeholder in textbox input type and to do that with CSS3, I used to following block of code:
in html, we have :
<!DOCTYPE html>
<html>
<head>
<title>My Page
<meta charset="utf-8" />
</head>
<body>
<div class="container">
Enter Name : <input type="text" placeholder="Enter your full name"/>
</div>
</body>
v/html>
and in CSS we had :
body {
font-family: "calibri", Garamond, 'Comic Sans';
color:white;
}
.container{
background-color:gray;
padding:8px 30px;
margin:0 auto;
margin-top:5px !important;
display:inline-block;
position:absolute;
left:27%;
}
input::-webkit-input-placeholder:after {
content:'*';
color: #007f80;
}
input:-moz-placeholder :after{
content:'*';
color: #007f80;
}
0 Comment(s)