Site logo

Archived topic

Different images for header site logo and mobile header logo

8 replies · Started by David on October 16, 2017

Viewing posts 1–9 of 9

Tom,

I have different images for the header site logo and mobile menu logo, and they are different sizes with different aspect ratios. I've tried this:

.site-logo .header-image {
width:125px;
height:83px;
}

.mobile-header-logo .header-image {
width:170px;
height:40px;
}

The above CSS sets the size to 170/40 in both cases. If those entries are flipped, the size is 125/83 in both cases. I welcome your advice on how to define distinct sizes.

Regards,

David Woosley

Hi there,

Can you link us to the site in question? Thanks!

No, not really. It's on a local server.

What are the unique selectors for those two images?

Thanks, David.

Site logo should be this: https://docs.generatepress.com/article/adding-svg-logo/#setting-the-size

Mobile header logo should be this:

@media (max-width: 768px) {
    .main-navigation .site-logo.navigation-logo img, .mobile-header-navigation .site-logo.mobile-header-logo img {
        width: 10px;
        height: 62px;
    }
}

Keep in mind that the mobile header logo also has 10px default padding applied.

Works like a charm. You are my hero.

Thanks, David.

Glad I could help :)

Is there another problem now? What am I looking for?

Is this not self-explanatory? Please view in desktop and mobile mode.

http://woosleyinc.com/

Thanks, D.

This archived topic is closed to new replies.