hello, I'd like to modify my grid layout for mobile display by always prioritising Images. I've already tried using ‘Order’ in CSS but it doesn't work.
eg:
Text1
Text2
Normally it is displayed like:
image1 text1
text2 image2
and on mobile, it should always be displayed in the order :
-image1
-text1
-image2
-text2
What I use is a CSS grid feature called grid areas.
For example, if I want two columns, one for text and one for an image. On desktop I want my text on the left side, but for mobile I want the image on top:
In your markup, give each column an appropriate class name
Then in your css you assign those column's classes to a grid area. I use the same grid-area name as my class just to avoid confusing myself but the names don't need to be the same
Then where you set up your grid, you reference these areas,using the "grid-template-areas" feature -- in the order you want them to appear. So since in my case my mobile layout is the default I do it with the image column first.
Umbraco Grid
hello, I'd like to modify my grid layout for mobile display by always prioritising Images. I've already tried using ‘Order’ in CSS but it doesn't work.
eg:
Text1
Text2
Normally it is displayed like:
image1 text1 text2 image2
and on mobile, it should always be displayed in the order : -image1 -text1 -image2 -text2
What I use is a CSS grid feature called grid areas.
For example, if I want two columns, one for text and one for an image. On desktop I want my text on the left side, but for mobile I want the image on top:
In your markup, give each column an appropriate class name
Then in your css you assign those column's classes to a grid area. I use the same grid-area name as my class just to avoid confusing myself but the names don't need to be the same
Then where you set up your grid, you reference these areas,using the "grid-template-areas" feature -- in the order you want them to appear. So since in my case my mobile layout is the default I do it with the image column first.
Then for my desktop display override, I swap the column order
As I interpreted it, your question was more about CSS grid than the Umbraco block grid. If that is not the case then disregard my answer and clarify.
is working on a reply...