<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Different logo on mobile - css not working in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Different-logo-on-mobile-css-not-working/m-p/861787#M36198</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/128252"&gt;@seanddavies1&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;displaying a different logo on mobile is a little bit more work.&lt;BR /&gt;Changing the CSS is a great start but you need also to remove the initial logo for that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have several options:&lt;/P&gt;
&lt;P&gt;1. Change the header.html file to something like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;header class="desktop"&amp;gt;
...
&amp;lt;div class="logo"&amp;gt;
{% module 'dekstop_logo' path="/@hubspot/logo.module" label="Desktop logo"%}
&amp;lt;/div&amp;gt;
...
&amp;lt;/header&amp;gt;

&amp;lt;header class="mobile"&amp;gt;
...
&amp;lt;div class="logo"&amp;gt;
{% module 'mobile_logo' path="/@hubspot/logo.module" label="mobile logo"%}
&amp;lt;/div&amp;gt;
...
&amp;lt;/header&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;This will give you two logo options in your global header settings. You'll need to check the "overwrite logo" setting in the mobile one and select your desired logo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Working with only CSS&lt;/P&gt;
&lt;P&gt;First you'll need to delete the logo module from the header.html file. After that you can write your code something like this:&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;{# start mobile logo #}
@media screen and (max-width: 767px) {
.header-logo {
content: url("https://7506377.fs1.hubspotusercontent-na1.net/hubfs/7506377/Logo.png");
}
}

{# start desktop logo #}
@media screen and (min-width: 768px) {
.header-logo {
content: url("PATH-TO-DESKTOP-LOGO");
}
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Working with brandkits:&lt;/P&gt;
&lt;P&gt;You can add the brandkit logos to the CSS approach like this:&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;{# start mobile logo #}
@media screen and (max-width: 767px) {
.header-logo {
content: url("{{brand_settings.logos[1].src}}");
}
}

{# start desktop logo #}
@media screen and (min-width: 768px) {
.header-logo {
content: url("{{brand_settings.primaryLogo.src}}");
}
}&lt;/LI-CODE&gt;
&lt;P&gt;you'll need to set the desktop one as primary(first) logo and the mobile one as the second one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2023 16:46:34 GMT</pubDate>
    <dc:creator>Anton</dc:creator>
    <dc:date>2023-10-09T16:46:34Z</dc:date>
    <item>
      <title>Different logo on mobile - css not working</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Different-logo-on-mobile-css-not-working/m-p/861522#M36197</link>
      <description>&lt;P&gt;I'm trying to use some CSS I found on another forum post to show a different logo on mobile screens (due to the background colour on mobile making the logo not visible).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried adding it in the global site header settings and also on individual page settings but can't get it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "replace default logo" option is enabled in the header settings for the logo, so I'm not sure if that somehow overwrites the CSS I'm using below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;style&amp;gt;&lt;BR /&gt;@media screen and (max-width: 767px) {&lt;BR /&gt;.header-logo {&lt;BR /&gt;content: url("https://7506377.fs1.hubspotusercontent-na1.net/hubfs/7506377/Logo.png");&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;/style&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 09:29:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Different-logo-on-mobile-css-not-working/m-p/861522#M36197</guid>
      <dc:creator>seanddavies1</dc:creator>
      <dc:date>2023-10-09T09:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Different logo on mobile - css not working</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Different-logo-on-mobile-css-not-working/m-p/861787#M36198</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/128252"&gt;@seanddavies1&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;displaying a different logo on mobile is a little bit more work.&lt;BR /&gt;Changing the CSS is a great start but you need also to remove the initial logo for that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have several options:&lt;/P&gt;
&lt;P&gt;1. Change the header.html file to something like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;header class="desktop"&amp;gt;
...
&amp;lt;div class="logo"&amp;gt;
{% module 'dekstop_logo' path="/@hubspot/logo.module" label="Desktop logo"%}
&amp;lt;/div&amp;gt;
...
&amp;lt;/header&amp;gt;

&amp;lt;header class="mobile"&amp;gt;
...
&amp;lt;div class="logo"&amp;gt;
{% module 'mobile_logo' path="/@hubspot/logo.module" label="mobile logo"%}
&amp;lt;/div&amp;gt;
...
&amp;lt;/header&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;This will give you two logo options in your global header settings. You'll need to check the "overwrite logo" setting in the mobile one and select your desired logo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Working with only CSS&lt;/P&gt;
&lt;P&gt;First you'll need to delete the logo module from the header.html file. After that you can write your code something like this:&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;{# start mobile logo #}
@media screen and (max-width: 767px) {
.header-logo {
content: url("https://7506377.fs1.hubspotusercontent-na1.net/hubfs/7506377/Logo.png");
}
}

{# start desktop logo #}
@media screen and (min-width: 768px) {
.header-logo {
content: url("PATH-TO-DESKTOP-LOGO");
}
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Working with brandkits:&lt;/P&gt;
&lt;P&gt;You can add the brandkit logos to the CSS approach like this:&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;{# start mobile logo #}
@media screen and (max-width: 767px) {
.header-logo {
content: url("{{brand_settings.logos[1].src}}");
}
}

{# start desktop logo #}
@media screen and (min-width: 768px) {
.header-logo {
content: url("{{brand_settings.primaryLogo.src}}");
}
}&lt;/LI-CODE&gt;
&lt;P&gt;you'll need to set the desktop one as primary(first) logo and the mobile one as the second one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 16:46:34 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Different-logo-on-mobile-css-not-working/m-p/861787#M36198</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2023-10-09T16:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Different logo on mobile - css not working</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Different-logo-on-mobile-css-not-working/m-p/861822#M36200</link>
      <description>&lt;P&gt;I took a quick look at your site and there doesn't seem to be any element with a class "header-logo".&lt;BR /&gt;&lt;BR /&gt;The method you posted seems to work when targeting your logo correctly like so:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/83477"&gt;@media&lt;/a&gt; screen and (max-width: 767px) {
#hs_cos_wrapper_site_logo img {
content: url("https://7506377.fs1.hubspotusercontent-na1.net/hubfs/7506377/Logo.png");
}
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="profile2022a" style="width: 100px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/71500iE96AB1F9E9E277B9/image-size/small?v=v2&amp;amp;px=200" role="button" title="profile2022a" alt="profile2022a" /&gt;&lt;/span&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;Barry Grennan&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Freelance HubSpot CMS Developer&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.seoanseo.ca?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Website&lt;/A&gt; | &lt;A href="https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity" target="_blank" rel="nofollow noopener noreferrer"&gt;Contact&lt;/A&gt; | &lt;A href="https://www.linkedin.com/in/barrygrennan" target="_blank" rel="nofollow noopener noreferrer"&gt;LinkedIn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 18:00:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Different-logo-on-mobile-css-not-working/m-p/861822#M36200</guid>
      <dc:creator>BarryGrennan</dc:creator>
      <dc:date>2023-10-09T18:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Different logo on mobile - css not working</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Different-logo-on-mobile-css-not-working/m-p/861842#M36203</link>
      <description>&lt;P&gt;This worked perfectly, thank you so much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 18:37:48 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Different-logo-on-mobile-css-not-working/m-p/861842#M36203</guid>
      <dc:creator>seanddavies1</dc:creator>
      <dc:date>2023-10-09T18:37:48Z</dc:date>
    </item>
  </channel>
</rss>

