Site logo

Archived topic

Padding in primary menu

7 replies · Started by Pablo Rodríguez on July 27, 2018

Viewing posts 1–8 of 8

Hello, how I can define the padding (right and left) for the primary menu? The menu occupies the entire width of the container, and I would like it to align with the content

Hi there,

You can add padding like so:

.main-navigation ul {
	padding-left: 10px;
	padding-right: 10px;
}

This may cause longer menus to wrap to a new line on smaller screens though.

Ok, thank you, the question is that my menu has a blue background, and I would like that blue background to be reduced when I enter the padding. I mean, that margin would be white, like the background of the page

OK this should help with the code above:

.main-navigation:not(.mobile-header-navigation) {
	background-color: #fff;
}
.main-navigation:not(.mobile-header-navigation) ul li {
	background-color: #006fb9;
}

Thanks, David, but doing so, the mobile menu also turns white.

I updated the code here:

Ok, perfect, David, now it's perfect, I think ;-)

Haha here to help if needed :)

This archived topic is closed to new replies.