gpt4 book ai didi

html - 如何覆盖自定义占位符 css

转载 作者:太空宇宙 更新时间:2023-11-04 03:27:38 24 4
gpt4 key购买 nike

我有一个表单,在从移动屏幕查看时需要占位符。我在桌面模式下不需要它们,所以我添加了一些字体为白色的 css,直到屏幕分辨率中断到移动设备。然后它会改变颜色以使其可见。问题是在桌面模式下我需要显示一些文本区域来显示占位符。我如何覆盖样式表中的 css?

input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { 
color: #FFFFFF !important;
}
input:-moz-placeholder, textarea:-moz-placeholder {
color: #FFFFFF !important;
}
input::-moz-placeholder, textarea::-moz-placeholder {
color: #FFFFFF !important;
}
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
color: #FFFFFF !important;
}
@media (max-width: 1070px) {
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
color: #737373 !important;
}
input:-moz-placeholder, textarea:-moz-placeholder {
color: #737373 !important;
}
input::-moz-placeholder, textarea::-moz-placeholder {
color: #737373 !important;
}
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
color: #737373 !important;
}
}

最佳答案

添加可见类

.visible::-webkit-input-placeholder{
color: #000 !important;
}

将上面的类添加到需要显示占位符的textarea中

关于html - 如何覆盖自定义占位符 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26844883/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com