This is a demo page for this blog post.
<input required />... and CSS like this...
input[required]::before { content: '*'; position: absolute; top: 0; left: 1em; color: red; }... to get something that looks like this...
Try viewing this form in your favorite browser. The HTML is beside the form element, and the CSS used is (essentially) that which is displayed above.
In the latest versions of Firefox, Safari, Opera, and IE, you will see absolutely nothing is added to the page via the above CSS. In the latest Chrome you will see the generated-content, but only for radio
, checkbox
, progress
, color
and file
input types, all of which I assume are oversights on the Chrome devs' part, since no other types allow it, and no other browser allows it at all...