Site logo

[Resolved] Align Container to middle of page

Home Forums Support [Resolved] Align Container to middle of page

Home Forums Support Align Container to middle of page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1705926
    Louis

    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.

    #1706054
    Elvin
    Staff
    Customer Support

    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.

    #1707276
    Louis

    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;
    }

    #1707325
    Elvin
    Staff
    Customer Support

    Try adding margin: auto;

    #1707330
    Louis

    That’s PERFECT! Thank you…

    #1707357
    Elvin
    Staff
    Customer Support

    No problem. Glad you got it sorted. 🙂

    #2594973
    Steve

    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!

    #2594999
    Leo
    Staff
    Customer Support

    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 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.