Jump to content

Transparent header on desktop and ipad, solid header on mobile

Recommended Posts

Posted

Hi, 

 

I am using this code below to create a semi-transparent header on scroll.

Now, my client wants a solid black header to show on mobile view only, with the semi-transparent header showing on desktop and iPad.  

 

The code I'm using: 

 

#header {
background: rgba(0,0,0,0.5);
}

 

Link: https://rhubarb-apricots-m3lb.squarespace.com/

Password: Hazel

 

Thank you for your help! 

Poppy

Posted
5 minutes ago, tuanphan said:

I think the code should be

@media only screen and (max-width: 767px) {
    .header-border, header#header {
        background-color: rgba(0,0,0,0.2) !important
    }
}

 

@tuanphan Post mentioned to create solid black background color on mobile view. Your solution will turn the background transparent. 

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

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.