[英]On Edge Browser, how to change input placeholder text color using CSS?
在Edge Browser上,我無法更改輸入占位符顏色。
:-ms-input-placeholder
無法正常工作,但在IE 10
和IE 11
上運行正常。
input:-ms-input-placeholder {
font-style:italic;
color: red;
background-color: yellow;
}
反正有沒有使用CSS?
:: - webkit-input-placeholder(Chrome / Safari / Opera)
:-ms-input-placeholder for IE。
:: - ms-input-placeholder for Edge(也支持webkit前綴)
請注意雙冒號語法
我想在上面的@Paulie_D的答案中回答@ ken的評論。
這有效: input[type="text"]::-ms-input-placeholder { color: #000; }
input[type="text"]::-ms-input-placeholder { color: #000; }
這不是: input[type="text"]::placeholder, input[type="text"]::-ms-input-placeholder { color: #000; }
input[type="text"]::placeholder, input[type="text"]::-ms-input-placeholder { color: #000; }
我不確定為什么,但肯定看來-ms-input-placeholder偽元素只有在與其他指令分開時才有效。
對於當前版本的Microsoft Edge瀏覽器,占位符無法正常工作。 看看這個問題Microsoft Edge占位符錯誤 。 如果占位符不可見,請嘗試刪除position: relative
和:-webkit-input-placeholder
opacity。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.