3

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
  • 1
    I'm not very sure how java is related to css, which is applied to html by browser? Commented Mar 18, 2016 at 17:02

1 Answer 1

5

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>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.