• Resolved brio39

    (@brio39)


    I changed the header to include our logo and a sponsors. My problem is I can’t seem to get the linked logo to show up on the right. I have tried a bunch of different css codes and can’t figure out what I’m doing wrong.

    I have a child theme and my site is https://www.robinsonandtoler.com/wp

    Any suggestions would be greatly appreciated!

Viewing 15 replies - 1 through 15 (of 18 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Remember to remove your coming soon page

    Thread Starter brio39

    (@brio39)

    Thank you, I removed it.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Have you tried this:

    #bio-image {
     text-align: right;
    }

    Thread Starter brio39

    (@brio39)

    I have, when I do that it takes everything to the right. And the Trusted Choice logo is still under the company logo. I want them to be next to each other.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try creating a structure where the two images are wrapped in divs with descriptive classes so that you can target them in CSS more easily, e.g.

    <div class="logo">
     <img src="..." alt="logo" />
    </div>
    <div class="sub-logo">
     <img src="..." alt="trusted choice logo" />
    </div>

    Thread Starter brio39

    (@brio39)

    If this helps here is the code I changed/added

    css:

    /* =Navigation
    ----------------------------------------------- */
    #site-navigation {
    line-height: 3em;
    background-color: #3c6398;
    text-transform:uppercase;
    margin-top: -6px;
    }
    
    /* =Layout
    ----------------------------------------------- */
    
    #masthead{
    width: 1140px;
    margin: 0 auto;
    background-color: transparent;
    margin-top: 5px;
    }
    
    .site-main{
    	background-color: #fff;
    }
    
    #bio-image {
        float: left;
        margin: 1px;
    }
    
    #tc-image {
     text-align: right;
    }
    
    .site-branding {
        margin-left: 0;
    }
    
    #header-right {
        margin: 50px 50px 0 0;
    }
    
    h1.site-title {
        clear: none;
        font-size: 2.9em;
        margin-top: 50px;
    }
    
    h2.site-description {
        margin-left: 50px;
        clear: none;
    }

    header.php:

    <div id="bio-image">
    <img src="https://www.robinsonandtoler.com/wp-content/uploads/2013/12/header-image.png" alt="bio image" />
    			<a href="https://www.trustedchoice.com/">
    <img src="https://www.robinsonandtoler.com/wp-content/uploads/2013/12/tc-image.png" alt="tc image" />

    Thread Starter brio39

    (@brio39)

    In your code, where do I put the site link for the trusted choice site?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Instead of this:

    <div id="bio-image">
    <img src="https://www.robinsonandtoler.com/wp-content/uploads/2013/12/header-image.png" alt="bio image" />
    			<a href="https://www.trustedchoice.com/">
    <img src="https://www.robinsonandtoler.com/wp-content/uploads/2013/12/tc-image.png" alt="tc image" />

    Do this:

    <div id="bio-image">
     <div class="logo main">
      <img src="https://www.robinsonandtoler.com/wp-content/uploads/2013/12/header-image.png" alt="bio image" />
     </div>
     <div class="logo sub">
      <a href="https://www.trustedchoice.com/">
        <img src="https://www.robinsonandtoler.com/wp-content/uploads/2013/12/tc-image.png" alt="tc image" />
      </a>
     </div>

    Thread Starter brio39

    (@brio39)

    Ok, I replaced mine with yours and it looks the same. Do I need to change the css too?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Also reduce the widths of your logos so that they don’t have unnecessary white space, they’re not unnecessarily wide.

    Thread Starter brio39

    (@brio39)

    I just uploaded cropped images. So now I just need to get the company logo centered and the Trusted logo on the right.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Add this CSS:

    .logo.main {
     float: left;
    }
    
    .logo.sub {
     float: right;
    }

    Thread Starter brio39

    (@brio39)

    Great, they are on the same line! Now to get the main logo to center what do I change?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Instead of this:

    .logo.main {
     float: left;
    }

    Use this:

    .logo.main {
     float: left;
     width: 50%;
     text-align: right;
    }
    
    .logo.main img {
     margin-right: -199px;
    }

    Thread Starter brio39

    (@brio39)

    Perfect!!! Thank you so much! I’ve been at this for hours! You just saved the rest of my day. Thanks again and have a wonderful day!

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Position a logo to the right side of the header’ is closed to new replies.