html - Adding placeholder content in css unable to clear the text while entering the data in input field -
added content in palceholder using css problem when adding data in text box placeholder content have added using css not getting cleared.
.applynowemail.contactemail:after { content: '*'; position: absolute; color: #f00; /* margin-top: -36px; margin-left: 52px; */ }
<div class="applynowemail contactemail"> <input type="email" class="form-control emails" id="email" name="email" value="<?php echo set_value('email');?>" placeholder="email" required> </div>
here's css solution:
- it requires
.emails:valid + .required { display:none; }
- the asterisk in
<span>
element
.required { color: #f00; position:absolute; left:2px; } .applynowemail{ position:relative; } .emails:valid + .required { display:none; }
<div class="applynowemail contactemail"> <input type="text" class="form-control emails" id="email" name="email" value="some email" placeholder=" email" required> <span class="required">*</span> </div>
Comments
Post a Comment