PoppyShotts Posted August 11, 2023 Posted August 11, 2023 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
Lesum Posted August 11, 2023 Posted August 11, 2023 Hi Poppy, here is a code snippet to show solid black header only on mobile: @media only screen and (max-width: 767px) { #header { background: rgba(0,0,0,1) !important; } } tuanphan 1 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?
tuanphan Posted August 12, 2023 Posted August 12, 2023 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 } } Lesum 1 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!)
Lesum Posted August 12, 2023 Posted August 12, 2023 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?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment