我正在使用all: unset,<input type="password" placeholder="text of placeholder">占位符變成點。
HTML:
<input type="password" placeholder="text of placeholder">
CSS:
::placeholder {
all: unset;
}
占位符的錯誤視覺結果:

有沒有辦法仍然使用all: unset并帶回正確顯示的占位符的值?
CodePen 示例
uj5u.com熱心網友回復:
試試-webkit-text-security: initial;(https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-security)
.reset-input::placeholder {
all: unset;
-webkit-text-security: initial;
}
<label>Reset Input</label>
<input class="reset-input" type="password" placeholder="placeholder text">
<br><br>
<label>UnReset Input</label>
<input type="password" placeholder="placeholder text">
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/435407.html
