Centring 2 divs in a div

  • Unknown's avatar

    Hi,
    I am trying to centre 2 divs that sit side by side within a div. I have got so far but would like the two divs to sit closer together but can’t seem to get the CSS to do it.

    The divs sit at the footer on the home page and contain “Online presence by Pale September ” and “privacy policy”. Ideally I would like the gap between the two to be smaller.
    Any ideas? Any help would be much appreciated.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi, neurologiceurope,

    Current CSS as follow:

    column-1-2-f {
        margin: 10px auto;
        max-width: 40%;
        text-align: center;
    }
    .column-1-2-footer.column-1 {
        width: 55%;
        text-align: left;
        float: left;
    }
    .column-1-2-footer.column-2 {
        width: 30%;
        text-align: right;
        float: right;
    }
    
    .column-1-2-footer.column-1, .column-1-2-footer.column-2 {
        text-align: center;
    }
    

    Change below CSS class for footer:

    column-1-2-f {
        display: table;
        margin: 10px auto;
        max-width: 100%; 
        text-align: center;
    }
    
    .column-1-2-footer.column-1 {
       /* width: 55%;*/
        text-align: left;
        float: left;
    }
    .column-1-2-footer.column-2 {
        /* width: 30%; */
        text-align: right;
        float: right;
    }
    .column-1-2-footer.column-1, .column-1-2-footer.column-2 {
        text-align: center;
        display: table-cell; 
        width: fit-content;
    }

    Major changes are displaying <div> as table using display attribute.

    After doing above changes page looks like https://imgur.com/a/m75cbP4

  • Unknown's avatar

    Thank you smooch for your help. I have made the changes as you suggest but I don’t get the same as your screenshot (which is perfect).
    Have I made a mistake somewhere?

  • Unknown's avatar
  • Unknown's avatar

    Hi neurologiceurope

    I tried to look at your website to give send you more help. But it is not visible. Have you change domain name?

  • Unknown's avatar

    Thank you for having a look. Yes (another issue)but moved the primary domain back to the WP url so you can see it.

  • The topic ‘Centring 2 divs in a div’ is closed to new replies.