Media query in THymeleaf

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Media query in THymeleaf

vidya
I see that we have tags, th:media, th:background and th:max-width.

My requirement is to set an appropriate image based on the media screen width size in thymeleaf.
Example:

For max-width= 750px, set image = image1.jpg
For max-width = 900 px, set image = image2.jpg

I have the respective style set in css file. I want to override the same in the thymeleaf html. Please help !!!
Reply | Threaded
Open this post in threaded view
|

Re: Media query in THymeleaf

Zemi
Administrator
Hello,

you don't need to use Thymeleaf code (th:media...) if you don't want to set up server-side values.

Just put your CSS code unmodified.

Regards,
   Zemi