• I currently have a sponsor banner on my blog header which is left justified which I want to center. I have tried multiple times changing the style sheet or including extra code in the header.php with varied results but none which simply center the ad.
    Some one please help me to resolve?

    Here is my blog: https://www.investor-insight.com.au/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try adding the margin-right to the CSS code:

    #header .sponsor {
        float: right;
        margin-right: 130px;
        padding: 5px 0;
    }

    Generally, you’d remove the float-right and use margin: 0 auto; to center it, but because of how the below elements are coded, removing the float messes up the page…

    Thread Starter trentw

    (@trentw)

    Thanks WPyogi. That was the trouble I had been running into when changing the float. It worked great!
    Cheers

    The only thing to make a note of is that if you change the ad at some point and it’s a different width — then you’d need to adjust that margin to keep it centered…

    Thread Starter trentw

    (@trentw)

    Great will remember that and do so if need be.
    Thanks again

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