-1

I want to parse css file using java code. e.g. as below. particular class and inside that different images. And I want to change background dynamically. Can someone provide give me example for same. Thanks.

classname {

background-image: -moz-linear-gradient(top, #666666, #666666);

}
2

1 Answer 1

2

Ehm, You should really google before asking questions like this. However, I did the work for you and found a number of libraries:

https://github.com/radkovo/jStyleParser

https://github.com/phax/ph-css

(Have not tested any of them just using them as example)

Conclusion: There is no "standard" way to parse css, you have to do it yourself or use a library.

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.