Jump to content

Different logo and title placement for web and mobile

Recommended Posts

Site URL: http://leirbaaletlyd.no

Hello everyone,

I'm quite new to this; I have been working on my website for a couple of weeks.

I've managed to glean from the forums here how to display both logo and title for my site header, and have been quite happy with my design (still undecided on the color scheme, though). However, when I added a dark photograph to the top of my homepage, I saw that I needed to add a different logo to that particular page. I've managed to do something of the sort by adding css styling to the advanced-section of that page (also from what I've read here), but now the logo only displays at top left screen, regardless of screen size - whereas all other pages has logo and title left for web, and logo above title centered for mobile, which is what I prefer.

Here's what the other pages look like:

logotitle_left_web_preferred.thumb.png.4fd5b807365f1f9b7d0ccc7a17a1c588.png

Logotitle_centre_mobile_preferred.png.065da82c8dd16d767d8cb80564df4b66.png

 

And here's the troublesome mobile one:

logotitle_left_mobile.png.7834a51c7ea8f8df57bc80e25915145e.png

and the working web-version:

logotitle_left_web.thumb.png.0b126a0eec4de4aa3cd1bf7861380df5.png

Website at http://www.leirbaaletlyd.no

Pw: BaaletsKnitren

Any help would be much appreciated!

Kind regards,

Roald

 

 

Link to comment

Thanks for answering! Hm.. No, unfortunately, that didn't do it. Should I use media query?

I don't know enough about this to see what (if anything) interacts, but I have two bits of css relating to the logo and title - both in the custom css, and in the advanced page header code injection for the specific page. 

 

From custom css:

/* Display both logo and site title in header */

.header-title-logo a:after {
    content: "Leirbålet lydproduksjon";
    display: block;
      font-family: 'YomogiRegular';
    font-size: 25px;
    text-align: center;
    vertical-align: center;
    font-weight:900;
    padding-top: 5px;
}
.header-title-logo img {
    vertical-align: left;
}
 

and <style>
  .header-title-logo img {
    visibility: hidden;
}
  .header-title-logo a {
    background-image: url("https://static1.squarespace.com/static/624bf2c0638f3073bec82e2b/t/62f516d2a502dd6bdb5cfaee/1660229330500/logo+lyse+glor_or.png");
    background-size: contain;
    background-repeat: no-repeat;
      vertical-align: center;
  }
   .header-title-logo a:after {
      color: #F4F5F1;
}
</style>

Any other ideas?

Kind regards,

Roald

 

 

Link to comment
17 hours ago, roligeroald said:

Thanks for answering! Hm.. No, unfortunately, that didn't do it. Should I use media query?

I don't know enough about this to see what (if anything) interacts, but I have two bits of css relating to the logo and title - both in the custom css, and in the advanced page header code injection for the specific page. 

 

From custom css:

/* Display both logo and site title in header */

.header-title-logo a:after {
    content: "Leirbålet lydproduksjon";
    display: block;
      font-family: 'YomogiRegular';
    font-size: 25px;
    text-align: center;
    vertical-align: center;
    font-weight:900;
    padding-top: 5px;
}
.header-title-logo img {
    vertical-align: left;
}
 

and <style>
  .header-title-logo img {
    visibility: hidden;
}
  .header-title-logo a {
    background-image: url("https://static1.squarespace.com/static/624bf2c0638f3073bec82e2b/t/62f516d2a502dd6bdb5cfaee/1660229330500/logo+lyse+glor_or.png");
    background-size: contain;
    background-repeat: no-repeat;
      vertical-align: center;
  }
   .header-title-logo a:after {
      color: #F4F5F1;
}
</style>

Any other ideas?

Kind regards,

Roald

 

 

To center logo, you need to change vertical-align: center to background-position: center;

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
19 minutes ago, tuanphan said:

To center logo, you need to change vertical-align: center to background-position: center;

Hi Tuan, 

Thanks for answering - that makes it look right on mobile/smaller devices, but also moves the logo on larger screens, and i would prefer if it looked the same as the other pages.

So mobile is fine:

1996471820_mobileviewcorrect.png.024da0a3d2db1d99d1974e17fdf17da6.png

But web is wrong: 

1986064711_webview-wrong.thumb.png.0f20d9f84b89a6f47081404ccd62396e.png

It should stay the same as :

logotitle_left_web_preferred.thumb.png.4fd5b807365f1f9b7d0ccc7a17a1c588.png

What can i do to achieve this?

Kind regards,

Roald

Link to comment
On 8/14/2022 at 4:57 PM, roligeroald said:

Hi Tuan, 

Thanks for answering - that makes it look right on mobile/smaller devices, but also moves the logo on larger screens, and i would prefer if it looked the same as the other pages.

So mobile is fine:

1996471820_mobileviewcorrect.png.024da0a3d2db1d99d1974e17fdf17da6.png

But web is wrong: 

1986064711_webview-wrong.thumb.png.0f20d9f84b89a6f47081404ccd62396e.png

It should stay the same as :

logotitle_left_web_preferred.thumb.png.4fd5b807365f1f9b7d0ccc7a17a1c588.png

What can i do to achieve this?

Kind regards,

Roald

You can keep old code, then add this code under </style> to make center on mobile

<style>
  @media screen and (max-width:767px) {
  .header-title-logo a {
      background-position: center !important;
    }}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.