Generate CSS from JSF managed bean

佐手、 提交于 2020-01-24 09:50:06

问题


I have this CSS code:

td[data-date='2016-03-08']{
  background-color: #F7F7F7;
}

I want to apply it on several dates that I want to load from a database. All this could happen inside my JSF managed bean where I generate the CSS code.

So my question is, how can I apply the CSS that I'm gonna get from my JSF managed bean?


回答1:


One way is to print it as body of HTML <style> tag which you put in HTML head.

<h:head>
    ...
    <style>#{bean.css}</style>
</h:head>


来源:https://stackoverflow.com/questions/36090096/generate-css-from-jsf-managed-bean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!