I'm looking for a way to style the asterisk in the placeholder.
Plain text like this in placeholder does not satisfy me:
Your e-mail*
Note that the placeholder text is variable, so static background will not play the trick
:after
works but you need to target the placeholder and not the input element...and then you can use position: absolute;
and top, left
properties to move your *
anywhere you want to...
Demo (Am not sure about other syntax but I've tested on webkit as am using firefox < 17 so if something is failing in any browser please let me know)
HTML
<input type="text" placeholder="E-Mail" />
CSS
::-webkit-input-placeholder:after {
content: '*';
}
:-moz-placeholder:after { /* Firefox 18- */
content: '*';
}
::-moz-placeholder:after { /* Firefox 19+ */
content: '*';
}
:-ms-input-placeholder:after {
content: '*';
}
This should do the trick. You can go here to find any HTML Entity to add to your placeholder. Make sure your head has a meta tag which uses charset UTF-8.
<head>
<meta charset="utf-8">
</head>
<input type="text" id="email" class="form-control input-lg formData" placeholder="Your Email*"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With