1249 465 | Chrome supports the placeholder attribute on But the following CSS doesn't do diddly squat to the placeholder's value: CSS:
HTML:
Is there a way to change the color of the placeholder text? I'm already using the jQuery placeholder plugin for the browsers that don't support the placeholder attribute natively. | ||||||||
|
1947 | ImplementationThere are three different implementations: pseudo-elements, pseudo-classes, and nothing.
IE up to version 9 and Opera up to version 12 do not support any CSS selector for placeholders. The discussion about the best implementation is still going on. Note the pseudo-elements act like real elements in the Shadow DOM. A CSS selectorsUser agents are required to ignore a rule with an unknown selector. See Selectors Level 3:
So we need separate rules for each browser. Otherwise the whole group would be ignored by all browsers.
Usage notes
| ||||||||||||||||||||
|
133 +50 |
This will style all Do not group these rules and make a separate rule for every selector (one invalid selector in a group makes the whole group invalid) | ||||||||||||||||
|
106 | You may also want to style textareas:
| |||
add comment |
38 | In addition to toscho's answer I've noticed some webkit inconsistencies between Chrome 9-10 and Safari 5 with the CSS properties supported that are worth noting. Specifically Chrome 9 and 10 do not support The full cross-browser comparison is here. | |||
add comment |
17 | For bootstrap LESS users, there is a mixin .placeholder:
| |||
add comment |
8 | this will work fine. DEMO HERE
| |||
add comment |
7 | In FF and IE, the normal input text color overrides the color property of placeholders. So, we need to
| |||
add comment |
6 | Cross-browser solution:
Credit: David Walsh | |||
add comment |
5 | I don't remember where I've found this code snippet on the internet (it wasn't written by me, don't remember where I've found it, nor who wrote it).
Just load this javascript and then edit your placeholder with CSS by calling this rule:
| ||||||||
|
2 | How about this
No CSS or placeholder, but you get the same functionality. | ||||||||||||||||
|
source - http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css
'Development > CSS' 카테고리의 다른 글
css - position absolute center (0) | 2014.05.04 |
---|---|
css - Background-color displaying incorrectly in IE8 and IE9 (0) | 2014.04.29 |
css3 - transition (1) | 2014.04.27 |
css - 미디어쿼리(media query) @media (0) | 2013.11.19 |
css - 넓이(width)와 높이(height) 자동 조정하기 (0) | 2013.10.29 |