Archived topic
Align Container to middle of page
7 replies · Started by Louis on March 22, 2021
I'm note sure if this is a WP Show Posts, GenerateBlocks, or GeneratePress issue.
I've set my outer container to 1100px, and my inside container to 720px for readability. I'd like to align all blocks in the center.
See http://www.hammeracademy.co.za - the WP Show Posts blocks are aligned left. I'd like the blocks in the middle. Block editor doesn't have these options and I can't get this right with CSS.
Hi there,
I'm not sure I understand what you mean.
I've checked your site and the blocks seem centered as shown here: https://share.getcloudapp.com/04uAboqe
Perhaps this is already sorted out? Let us know.
Thanks Elvin,
I've checked the following browsers, not logged in, browser history, Cloudflare and Litespeed cache cleared (following the wise man's advice):
Chrome - aligned left
Safari - aligned middle
Opera - aligned left
MS Edge - aligned left
I'm targeting the following (and not sure how to center this):
.wp-show-posts-inner {
padding-left: 0px;
padding-right: 0px;
border-style: solid;
border-width: 1px;
border-color: #e6e6e6;
border-radius: 5px;
box-shadow: 2px 8px 20px 1px #e6e6e6;
max-width: 720px;
}
Try adding margin: auto;
That's PERFECT! Thank you...
No problem. Glad you got it sorted. :)
Elvin, since this thread isn't closed I have the same objective, but don't want to mess with css. Can't you achieve the same effect (center the content container) by adding the required left margin to the container?
Thanks!
Hi Steve,
This thread is a bit old and a lot has changed since then - especially with the new GB1.7.
Can you take a look at the examples at the top of the page and open a new topic if it doesn't help?
https://docs.generateblocks.com/article/container-overview/
Thanks :)