Keep grid design on mobile?
-
Hi there, I wan’t to create an image grid which does not stack the images on mobile, but keep the grid with smaller images instead.
I have been looking at the Grid overview documentation, but can’t find any solution for this.
Is this possible with the Grid Block, to keep grid design on mobile?
Thanks!
-
Hi there,
when you add a Grid, GB will output a Container for each of the Columns.
And by:a. Selecting a column Container block.
b. switching preview to Mobile
c. and changing the Contains layout > Width %https://docs.generateblocks.com/article/container-overview/#layout-–-grid-item
You can set the grid widths specifically for mobile. By default they are 100%. If you change each of them to match the Desktop Width % then you will keep the same layout.
As a note: you can Shift Click several Container Blocks inside a Grid, and then when you set the Width % or any common style it will apply to all those selected.
Thanks for the explanation, I see that it might be easier using a gallery block insted, when images are of different proportion and orientation, but then I can’t achieve masonry gallery
Is it possible to create masonry gallery with the grid block?
Not sure if this is something you are looking for, if so, you can achieve this with the structure in the below screenshot:
https://www.screencast.com/t/i09i1tudL2mHi Ying, thanks for sharing the structure, it looks like it is what I am looking fore, so I’m able to achieve this structure, so images with different orientation fits in without white space.
This is made with another block plugin, but I would prefer using GP Grid instead, if possible, so I will follow your example to see if it is possible.
I want to blur all the images in the grid, is it possible with css to add blur to all content in the grid?
Regards
CarstenI followed your structure, and it lookes good on desktop, but on mobile the images stacks up in one column.
How do I keep the six column layout on mobile, just with smaller images?
You still need to apply what said here:
https://ww.wp.xz.cn/support/topic/keep-grid-design-on-mobile/#post-15548456
Hi there, thanks for reminding me ;-).
I’m getting closer now. How do I remove the horizontal white space on desktop?
Mobile
Desktop
It looks fine in the editor
Thanks!
Click on the Grid, is there any value in the horizontal gap field?
If so, remove it.
If not, can you link me to the page so I can see what’s going on?
No value in the horizontal gap field, the url is wedate.dk
It’s because you are using thumbnail size of the images which is set to 200px in width.
4 x 200px = 800px which means 4 columns of the images only takes 800px width.
So if the image size looks ok for you, you can set the inner container width to 800px instead of 1100px.
Otherwise you’ll need to use bigger size of images to fill the columns.
Hi there, so for using thumbnails for smaller images, I just need to add more columns?
The grid should end up being a mosaic of very small images, any smart technique I could use like copy a container with images into another container?
I have trying adding this blur filter to the Additional CSS class(es) field, but with no effect. Im’m not sure if I should add the brackets as well to make it work?
-webkit-filter: blur(5px); /* Safari 6.0 - 9.0 */ filter: blur(5px);Thanks!
Hi there, so for using thumbnails for smaller images, I just need to add more columns?
Yes, you can.
any smart technique I could use like copy a container with images into another container?
Do not use copy as it copy paste the element with same id which might cause problem.
You can select the element and click the 3 dots icon > duplicate. This will generate a new set of element with new IDs.The additional CSS(es) class field in block editor is to enter CSS class, not CSS.
You can enter a class, eg:
blur-imgto the entire container block.Then add this CSS to customizer > additional CSS:
.blur-img img { -webkit-filter: blur(5px); /* Safari 6.0 - 9.0 */ filter: blur(5px); }Hi Ying, thanks for your duplicate advise and clarification about adding css class.
I have a couple of questions more, no rush, just when you got the time.
1. Why is the Image size option not available for all images?
2. How do I end the grid, so all images are levelled in the bottom?
3. What is going on here? url is wedate.dk
Thanks!
1. It should be, but image block is WP core block, I’m not sure what’s going on.
2. It’s tricky. You can set a
max-heightfor the Grid block, then make itoverflow-y:hidden;3. It’s because it’s not the right way to make your layout. You should only need 4 container block under the Grid, and keep on adding images to the 4 containers. If you add 5th container, it will wrap.
Hi there, it seems that the best solution is to use a regular grid with even rows of images.
Is it possible to have a grid as bagground with headings and buttons on top, or how do I achieve such a design?
Thanks!
The topic ‘Keep grid design on mobile?’ is closed to new replies.