【发布时间】:2016-08-29 02:34:32
【问题描述】:
我有一个后台带有视频的表单。当输入框中没有输入文本时,我希望它们的不透明度为 0。但是当值不为零时,我希望它们具有背景颜色。我在想我可以为此使用占位符。
现在我只显示输入焦点时的背景颜色,如下所示
.for_ajax_contact #contactform input[type="text"]:focus, .for_ajax_contact #contactform textarea:focus {
outline-width: 0;
background-color: #fff;
opacity: 0.8;
transition: all 0.3s linear 0s !important;
-webkit-transition: all 0.3s linear 0s !important;
}
有什么想法吗?
【问题讨论】:
-
你能添加完整的代码示例吗?
-
您可能必须使用 javascript 来完成此操作。
标签: css forms web placeholder