<分区>
标签 html css forms form-submit
<分区>
有没有办法在输入文本时更改提交按钮的颜色?不知道如果不使用 JavaScript 是否可行(不是一个非常熟练的编码人员!)。
CSS:
#a {
padding: 1px 3px 0px;
background: transparent;
border: 0;
outline: 0;
border-bottom: 0.8px solid #D3D3D3;
width: 300px;
height: 32px;
}
.bttn {
background-color: #FF0783;
border: none;
color: #ffffff;
text-align: center;
text-decoration: none;
font-size: 24px;
width: 216px;
height: 48px;
border-radius: 38px;
text-transform: none;
}
HTML:
<div style="text-align: center;"><input type="text" id="a" style="text-transform:uppercase; font-family: open-sans, sans-serif; font-style: normal; font-weight: 300; color: black; font-size: 24px; text-align: left;" maxlength="8" autofocus></div>
<div class="sbmt">
<button type="submit" class="bttn">Continue</button>
</div>
最佳答案
不,这是不可能通过 CSS 实现的。 CSS 没有(伪)值选择器。 this 的可能重复项.
关于html - 在字段中输入文本时更改提交按钮的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52174899/
相关文章:
html - 带有 : active state in IE and Opera 的多个类/ID 和类选择器
javascript - 当提交按钮上有单击事件时,表单不会提交
html - 如何在带有或不带有 Bootstrap 的 HTML 中显示字符 ":"前后对齐的单词?
javascript - 如何使用 php 重定向到上一页并保持所有填充的输入相同
javascript - 为什么ajax上传文件不需要在form标签中包含enctype ="multipart/form-data"?
javascript - jQuery 复选框脚本给出奇怪的结果