我正在尝试使用 style="width:60px"
设置 richfaces 日历的宽度,但它不起作用。
<rich:calendar id="givenDate" name="givenDate"
enableManualInput="true" style="width:60px"
datePattern="MM/dd/yyyy" value="#{shotController.adminDate}"
immediate = "true" required="true"
requiredMessage="#{msg.requiredmsg}" popup="true" />
谁能帮忙?
最佳答案
<rich:calendar>
标签组件是许多组件的组合,您可以设置每个组件的样式。对于输入,您应该使用 inputStyle
属性(property),或 inputClass
对于 CSS 定义的类:
<rich:calendar id="givenDate" name="givenDate"
enableManualInput="true"
<!-- this will be the style for the input textbox -->
inputStyle="width:60px"
datePattern="MM/dd/yyyy" value="#{shotController.adminDate}"
immediate = "true" required="true"
requiredMessage="#{msg.requiredmsg}" popup="true" />
另一种解决方案可能是重写特定日历组件的 CSS 样式。完整列表可在 RichFaces Component appendix A: Style classes 中找到。 .
更多信息:
关于calendar - 如何设置richfaces日历的宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11904904/