Change an HTML5 input's placeholder color with CSS

后端 未结 30 3178
猫巷女王i
猫巷女王i 2020-11-21 04:36

Chrome supports the placeholder attribute on input[type=text] elements (others probably do too).

But the following CSS doesn\'t do anything

30条回答
  •  一向
    一向 (楼主)
    2020-11-21 04:46

    You may also want to style textareas:

    input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
      color: #636363;
    }
    input:-moz-placeholder, textarea:-moz-placeholder {
      color: #636363;
    }
    

提交回复
热议问题