• Resolved thekhakinator

    (@thekhakinator)


    Hi, I’m having problems getting a logo top and center of my blog. I’ve tried a lot of solutions but haven’t succeeded, trying with both header.php and style.css. My closest was making the background image my logo, setting it to center, but the margin at the top of my site isn’t thick enough. Any suggestions? My site is http://grav-corp.com

    Here’s an image indicating where I am trying to put my logo:

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

    (@thekhakinator)

    This can be achieved through a little HTML and CSS. I suggest doing this in a child theme, if you are not using a child theme you really should as if you update the theme at some point in the future you will lose any of the changes you have made.

    I would personally do it this way:

    Within the header.php of your child theme enter
    <div class="your-class-name"></div> directly below <body <?php body_class(); ?>

    rename your-class-name to anything you like as long as it is unique. Then within your styles.css within your child theme add the following to the very bottom

    .your-class-name {
    	background:url(location-of-your-image.jpg) no-repeat center center;
    	height:200px;
    	width:100%;
    }

    You need to make a few changes to this in your case. Again change your-class-name to whatever you called it earlier but keep the . before

    change location-of-you-image.jpg to the actual URL of your image example http://www.domian.com/images/this-is-my-image.jpg

    and he height should be at least the height of your image.

    This is just one way of achieving the desired effect. This is just a quick way. You can then adjust the css to tidy up how it looks.

    Thread Starter thekhakinator

    (@thekhakinator)

    Thanks for the help!

    Thread Starter thekhakinator

    (@thekhakinator)

    Yep, that’s done the trick, cheers.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Logo aboslutely top center problem’ is closed to new replies.