[Resolved] centre a div in a section

Home Forums Support [Resolved] centre a div in a section

Home Forums Support centre a div in a section

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #230151
    haborg

    Hi,

    Trying to centre a div with four horizontal icons in a section on a page. The attribute “margin: auto” doesn’t work in the section. This is what I have tried:
    .icons {
    width: auto;
    hight: auto;
    display: block;
    margin: auto;
    }

    And this is the site: http://nackagarden.capito.se/

    Any suggestions?

    /Hakan

    #230179
    Lyle

    Hi haborg,

    My suggestion (sorry Tom πŸ™‚ ) is to use the free, lite version of the Beaver Builder plugin available on the WP Plugin repository here:

    https://wordpress.org/plugins/beaver-builder-lite-version/

    Then you will not need to use a GP Section, just launch BB on that page, drag out a 4 column row and add a Photo module to each one and set the required icons as the images … takes less than a minute πŸ™‚

    Cheers!
    Lyle

    #230205
    Tom
    Lead Developer
    Lead Developer

    That’s definitely one way πŸ™‚

    If you want to use your #icons div, you can do this:

    #icons {
        max-width: 800px;
        margin: 0 auto;
        text-align: center;
    }

    margin: 0 auto only works if the element has a width.

    #230214
    haborg

    Great!

    Thanks to both. Simple, smart and flexible solutions!

    Best,
    Hakan

    #230216
    Tom
    Lead Developer
    Lead Developer

    Glad I could help πŸ™‚

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