问题
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