-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);

}
EstevaoLuis
  • 2,422
  • 7
  • 33
  • 40
sudhanshu
  • 409
  • 1
  • 5
  • 12
  • 1
    Why don't you google it? first attempt - [CSS Parser](http://cssparser.sourceforge.net/) – Sasha Apr 25 '16 at 14:25
  • related: https://stackoverflow.com/questions/1513587/looking-for-a-css-parser-in-java – Nor.Z Apr 22 '23 at 02:43

1 Answers1

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.

Om Sao
  • 7,064
  • 2
  • 47
  • 61
Caspar Noree
  • 102
  • 1
  • 8