-
Alex_Kasi
Hi guys,
I have a pretty old headache with customizing the width or center alignment for Grid Block depending on the number of post previews to display inside it.
For example, I have a full-width container block with a 4-column grid-block inside. And works fine until it’s 4 posts to display. But if it’s only one, it fills only 25% of the screen width on the left. Everything on the right is blank. Is there some solution to control grid block width based on the number of existing items to display, to make sure that it’s always center-aligned?
An example of a page with only one item to display in the 4-column grid is in the private section.
-
Hi there,
You can select the grid block and set its
horizontal alignment
tocenter
, so it will be in the center.But there isn’t a built-in way to make the column wider based on post numbers, unfortunately. It will require custom JavaScript.
-
Alex_Kasi
Actually, it solves my problem 🙂
So thanks a lot for a fast solution, Ying!
-
You are welcome 🙂
- You must be logged in to reply to this topic.