Last active
March 3, 2022 12:35
-
-
Save mgaebler/b3a68928bccba0552b9e11d444969adc to your computer and use it in GitHub Desktop.
Placeholder hack for <input type="date" />
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input[type="date"]:before { | |
content: attr(placeholder) !important; | |
display: block; | |
width: 100%; | |
} | |
input[type="date"]:focus:before, | |
input[type="date"]:valid:before { | |
display: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment