Archived topic
how to add margin on header
7 replies · Started by Karsten on June 22, 2021
Hi Friends,
I am using full width header as you can see here
On desktop view I would like to add additional margin on the left and right side. Could you please help me with appropiate CSS?
Thank you very much
Karsten
Hi Karsten,
Try this CSS for desktop:
@media (min-width: 769px) {
#site-navigation {
padding: 0 40px;
}
}
Let me know :)
Hi Xing,
yes, this was very helpful, thank you.
Now I need some little more help with CSS.
As you can see here I would like to style the second menu item. I don't know how to address this menu item correctly.
Currently I am using this CSS, but it does not work properly. I have no clue why.
.menu-item-91551
{
background-color : orange;
color: #FFF;
line-height: 35px;
font-weight: bold;
}
Thank you for your help.
Karsten
Try this one instead:
.main-navigation .main-nav ul li.menu-item-91551 a {
background-color: orange;
color: #ffffff !important;
line-height: 35px !important;
font-weight: bold;
}
Let me know :)
Hello Ying,
thank you for this code which works fine.
But now I also need some CSS to add margin to main navigation when scrolling down.
Thank you
Do you mean add padding to the sticky navigation?
If so, try this CSS:
@media (min-width: 769px) {
nav#sticky-navigation {
padding: 45px 40px 25px 40px;
}
}
Thank you, Ying, that's what I was looking for.
You are welcome :)