java - <h :inputText> enabled/disabled - change background color

标签 java html css jsf richfaces

我可以更改残疾人的背景颜色吗 <h:inputText>

我试过这样做:

<h:inputText value="test" disabled="true" styleClass="input"/>

css 包含:

input:disabled {background-color:blue;}
input:enabled {background-color:red;}

结果是:

enter image description here

我尝试更改背景的原因是,因为我已经安装了 richfaces,禁用和启用具有相同的颜色,都是白色

谢谢

更新:

enter image description here

HTML:

<td class="width10">Směna:</td>
<td class="width15"><input name="bde:j_idt100" value="2011-05-18-S2" size="13" style="background-color: blue; color: red;" disabled="disabled" type="text"><input id="bde:shift" name="bde:shift" type="hidden"></td>
<td><input name="bde:j_idt102" value="ranní" class="input2" size="13" disabled="disabled" type="text"><input name="bde:j_idt103" value="admin" class="input2" size="13" disabled="disabled" type="text"></td>
</tr>
<tr class="rowEven">
<td class="width5"><input id="bde:f1" name="bde:f1" value="F1" tabindex="2" title="Novy pracovnik - vymaze vsechna pole formulare" class="btninput" type="submit"></td>
<td class="width10">Pracovník:</td>
<td class="width15">
<input id="bde:worker" name="bde:worker" class="input" size="13" tabindex="1" onblur="jsf.util.chain(this,event,'mojarra.ab(this,event,\'blur\',\'@this\',\'bde:inputName\')','mojarra.ab(this,event,\'blur\',\'@this\',\'bde:inputSname\')','mojarra.ab(this,event,\'blur\',\'@this\',\'bde:inputDep\')','mojarra.ab(this,event,\'blur\',\'@this\',\'bde:reportErr\')')" type="text"></td>

richfaces 生成的代码和 HTML 之间的图形差异:

enter image description here enter image description here

最佳答案

试试这个

<h:inputText value="test" disabled="disabled" style="background-color:blue; color:red;" />

关于java - <h :inputText> enabled/disabled - change background color,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6043214/

相关文章:

java - 使用 jedit 作为 IDE

java - apache-tomcat-8.0.14 中的内存泄漏

javascript - 在提交该页面之前检查表单字段值

html - Windows 7 高对比度主题覆盖 Firefox 中的网站颜色

jquery - 使用 Bootstrap 使输入/表单栏响应

javax.xml.transform.Transformer 转换后交换元素属性

java - 多线程运行时间计算

javascript - javascript弹出图库效果问题

javascript - jQuery `.click()` 不工作

html - 我怎样才能在这里使用另一种 css 库颜色而不是 Material Design?