HTML CSS examples for CSS Form:input
Use a :before or :after pseudo-element on an input field
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .field_with_errors {<!--from w w w . ja va2 s.co m--> display:inline; color:Chartreuse; } .field_with_errors input+span:after { content:"*" } </style> </head> <body> <div class="field_with_errors"> Lorem ip </div> <div class="field_with_errors"> <input type="text"> <span></span> </div> </body> </html>