• Resolved lofaro

    (@lofaro)


    Hello,

    Sorry for the potential duplicate but I haven’t found any answer to my problem in this forum despite my Google searches…

    I saw that lots of people want to center their whole site. For my purpose, I just want to center the header image, nothing more ??
    My site is https://benvenutoinitalia.net/ and I want to center the top logo “Benvenuto in Italia”.
    Does someone has an idea?

    For information, I use:
    – WordPress 3.9.1
    – a Twenty Fourteen child theme derived from Twenty Fourteen.

    Many thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Make a new banner with the width 1260 and be sure that you put the text in the middle. You can do that for instance with photoshop.

    Johanna

    Hi there, please paste this code in your child theme style.css.

    #site-header { text-align: center; }
     #site-header a { display: block; background: white; }

    Add this CSS rule to the end of your child theme’s style.css file:

    #site-header {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    It’s going to look a little odd because there’s a :before pseudo element that is set to black on the left. You can change it with this:

    .site:before {
       background: transparent;
    }

    Thread Starter lofaro

    (@lofaro)

    somedudes has written:

    Hi there, please paste this code in your child theme style.css.
    #site-header { text-align: center; }
    #site-header a { display: block; background: white; }

    Excellent, it works!
    Thank you somedudes for your fast reply.
    Thank you everybody as well ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to center header image’ is closed to new replies.