Archived topic
Sticky Header background color
7 replies · Started by KAMADEVA AB on May 5, 2021
By adding
.main-navigation.navigation-stick {
background-color: rgb(0,0,0,0.90);
}
I get the sticky navigation background to go black, but only in mobiew view. On tablet and desktop it is stil transparent. Any suggetsions?
Hi Martin,
Any chance you can link us to the site in question?
You can use the private information field.
Let me know :)
Here it it.
Try this CSS for desktop sticky navigation:
#sticky-navigation {
background-color: rgb(0,0,0,0.90);
}
Let me know :)
That didn't help.
Hi there,
you're adding the CSS inside an @media query - which is why it is only applying to the Mobile view.
This is how the CSS is at the moment:
@media (max-width: 768px) {
.mc4wp-form input[type=text],
.mc4wp-form input[type=email],
.mc4wp-form input[type=submit] {
width: 100%;
margin: 2px;
}
/* Logo, menu and seach */
#mobile-header .inside-navigation {
position: relative;
}
.site-logo.mobile-header-logo {
margin: 0;
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
}
#mobile-header .search-toggle {
order: -1;
margin-right: auto;
}
/* END Logo, menu and seach */
.main-navigation.navigation-stick {
background-color: rgb(0, 0, 0, 0.90) !important;
}
#sticky-navigation {
background-color: rgb(0, 0, 0, 0.90) !important;
}
} /* Add the CSS after this bracket */
I commented the last bracket - the CSS needs to come after that ( or before the @media line ).
Such a stupid mistake. Sorry for taking your time with such pitty thing. Thank you!
Glad to be of help