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:

  1. it requires .emails:valid + .required { display:none; }
  2. 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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -