我想在我的表格占位符中添加一个颜色asterix,这可能吗?
@R_404_323@
这是纯css解决方案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>