I wanna add a color asterix in my form's placeholder, is it possible?
Here is pure css solution IE10+
.input-placeholder { position: relative; } .input-placeholder input { padding: 10px; font-size: 25px; } .input-placeholder input:valid + .placeholder { display: none; } .placeholder { position: absolute; pointer-events: none; top: 0; bottom: 0; height: 25px; font-size: 25px; left: 10px; margin: auto; color: #ccc; } .placeholder span { color: red; }
<form novalidate> <div class="input-placeholder"> <input type="text" required> <div class="placeholder"> Email <span>*</span> </div> </div> <input type="submit"> </form>
1.4m articles
1.4m replys
5 comments
57.0k users