Last active
August 29, 2015 14:01
-
-
Save larswittenberg/14511d9029b499e8ee33 to your computer and use it in GitHub Desktop.
Styling HTML5 Placeholder
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
/******************************************************************************* | |
* Placehoder Styling | |
*******************************************************************************/ | |
@mixin placeholder { | |
&::-webkit-input-placeholder { @content; } | |
&:-moz-placeholder { @content; } // Firefox 18- | |
&::-moz-placeholder { @content; } // Firefox 19+ | |
&:-ms-input-placeholder { @content; } | |
} | |
/* Verwendung */ | |
input { | |
@include placeholder { | |
color: red; | |
} | |
} |
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
/* | |
Source: http://martinwolf.org/2012/10/24/snippet-styling-html5-placeholder/ | |
Source: http://css-tricks.com/snippets/css/style-placeholder-text/ | |
*/ | |
.my-input::-webkit-input-placeholder { | |
color: #555; | |
} | |
.my-input:-moz-placeholder { /* Firefox 18- */ | |
color: #555; | |
} | |
.my-input::-moz-placeholder { /* Firefox 19+*/ | |
color: #555; | |
} | |
.my-input:-ms-input-placeholder { | |
color: #555; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment