WordPress.org

Ready to get started?Download WordPress

Forums

Centering logo div (11 posts)

  1. BBostick
    Member
    Posted 1 year ago #

    Building a site with the Mosaic theme (child theme), and having trouble getting the logo div to center correctly. Can I accomplish this through style.css or a header.php? I haven't been able to get this exactly right yet, I know its through margins but.. your help is appreciated!

    http://edgewoodbldrsinc.com/

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    What CSS did you try?

  3. BBostick
    Member
    Posted 1 year ago #

    Honestly, I tried about 3 different methods, none worked so I didn't keep a record of them :-/

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Try adding this to your child theme style.css file:

    #logo {
        float: none;
    }
    
    #logo img {
        display: table;
        margin: 0 auto;
    }
  5. BBostick
    Member
    Posted 1 year ago #

    WPyogi, that worked - if you're ever in Charleston, SC I owe you a beer ;-). Gracias.

  6. BBostick
    Member
    Posted 11 months ago #

    Update - any idea why the above code in my child theme would cause the logo to be invisible on IE 8/9 ? When testing, I switch from my child theme to the base Mosaic theme and logo displays properly (on the left as originally intended).

  7. Andrew
    Forum Moderator
    Posted 11 months ago #

    In IE press F12 and make sure you're not viewing the site in quirks mode.

  8. BBostick
    Member
    Posted 11 months ago #

    I'm testing using Browserstack (I'm a mac guy) so I'll have to look at this later. Will give it a try though, thanks.

  9. Andrew
    Forum Moderator
    Posted 11 months ago #

    It may be something to do with display table, so just to be safe instead of this style:

    #logo img {
        display: table;
        margin: 0 auto;
    }

    Can you try this equivalent:

    h1#site-title { text-align: center; }
  10. BBostick
    Member
    Posted 11 months ago #

    It's working on the home page, not others.. ?

  11. BBostick
    Member
    Posted 11 months ago #

    Ok, think I got it with:

    h1#site-title, h1#site-title a, div#site-title, div#site-title a
    { text-align: center;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic