Left align text on desktop, center align on mobile

Hello and welcome to the forum.

There are probably a few ways to solve this with CSS or some other black magic but I would always try to go as pythonic as possible (hence the power of Anvil).
The first challenge you will have is how to identify whether the client code is running on a mobile device or a desktop. For that a quck search on the forum gives us this post

Then next challenge is changing the alignment. For that you will want a function to set this in code. When your form loads you can check the device type and then run this function to adjust the alignment.

What code have you written so far? Can you share a clone link so the community can tailor its response as closely as possible to your code?

3 Likes