• Resolved kanthe

    (@kanthe)


    Hello and thanks for a great work with this theme!

    I am trying to center the whole website (the body) I am working on. I have done a child theme to Customizr. Everywhere I look it seams the correct way to do it is to add the following to style.css:


    body {
    text-align: center;
    }
    #wrapper {
    width: 1170px;
    margin: 0 auto;
    text-align: left;
    }

    where wrapper is added around all content. I made this wrapper by adding the following to functions.php:


    /* Adding wrapper immediately inside body */
    add_action(‘__before_header’, ‘open_wrapper’);
    function open_wrapper() {
    ?>
    <div id=”wrapper”>
    <?php
    }
    add_action(‘__after_footer’, ‘close_wrapper’);
    function close_wrapper() {
    ?>
    </div>
    <?php
    }

    It centers fine in Firefox but in Chrome it is placed to the left. I observe that while loading in Chrome it first goes to the centre but then jumps to the left when finishing loading

    The website:

    https://andersson2.kanthe.se

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter kanthe

    (@kanthe)

    Check where you’ve added the </div> to #wrapper. Think it might be in wrong place.

    Well, it’s not really centered in Firefox. The problem is the <html> tag, and this:

    .video {
        float: left;
        margin: 4px 1.71429rem 0.857143rem 0;
    }

    the <html> has this video class, so remove that rule, or use a more specific rule for the “.video” elements you want to style.

    Thread Starter kanthe

    (@kanthe)

    Hi and sorry for late reply.

    Thanks, guys, it seems to be working in the major web browsers now. I think it was the .video issue but I’m not sure since it’s behaving a bit unpredictable. Still got a few issues to solve, but I’ll start a new thred in case I don’t figure it out myself.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Center body in Chrome’ is closed to new replies.