我正在使用 struts2 构建一个 web 应用程序,我广泛使用 struts2 标签。我无法将 CSS
样式应用于我的 struts2 textfields
、buttons
、labels
等。有什么窍门用于为 struts2 UI 组件设置 CSS
规则。
最佳答案
struts2 标签有两个用于此的属性,cssClass 和 cssStyle 属性。 cssClass 属性采用您在 CSS 文件中创建的类的名称。 cssStyle 属性采用表示 CSS 样式的字符串。例如
<s:checkbox cssClass="mycheckbox" label="checkbox test" name="checkboxField1" value="aBoolean" fieldValue="true"/>
和
<style>
.mycheckbox{
/* Your style here */
}
</style>
关于java - 如何给struts2标签添加CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2395070/