Magento 2 – How to Change Top Navigation Submenu Position

categorylayoutmagento2magento2.2PHP

I create a new theme for Magento 2 based on Luma theme. I change the submenu of the top navigation to be 100% width.

.navigation .level0 .submenu {
    max-width: 1280px; 
    width: 1280px; 
    padding: 25px 0;
}

And now I want to change the submenu position, right now the submenu start right selected category, I need to made the submenu to start from left side.

I try to add position: absolute; and left: 0; but is not working.

How I can move this submenu to start from left side?

enter image description here

Thank you

Best Answer

.ui-menu-item - change position to position: static;

.navigation > .ui-menu - change position to position: relative;

.ui-menu-item {position: static;}
.navigation > .ui-menu {position: relative;}

It should do the trick ;)

UPDATE: To override it through css use this:

.navigation ul {position: relative;}
.navigation li.level0 {position: static;}
.navigation .level0 .submenu {left: 0 !important;}