Appearance of header menu

  • Unknown's avatar

    Hi, I would like to have a rectangle of a certain color around the selected page instead of a line under it in the menu on the desktop mode. Is that possible?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hey there!

    .main-navigation .primary-menu .current_page_item > a, .main-navigation .primary-menu .current-menu-item > a, .main-navigation .primary-menu .current_page_ancestor > a {
    	background-color: #3359a5;
    	border-color: transparent;
    	padding: 5px;
    }

    Let me know if that doesn’t work!
    Sage

  • Unknown's avatar

    Is it possible to make the rectangle cover all the height of the header and be a little bit larger?

  • Unknown's avatar

    And also doing this changes only to the desktop version

  • Unknown's avatar

    Hey there,

    Sorry for my late response!

    This should do the trick:

    @media screen and (min-width: 896px) {
    	.primary-menu .menu-item {
    		margin: 0px;
    	}
    	.main-navigation .primary-menu .current_page_item > a, .main-navigation .primary-menu .current-menu-item > a, .main-navigation .primary-menu .current_page_ancestor > a, .main-navigation .primary-menu a:hover {
    		background-color: #3e69dc;
    		border-color: transparent;
    		color: #FFF;
    	}
    	.primary-menu a {
    		padding: 34px 10px;
    	}
    	.main-navigation {
    		margin-top: 0px;
    	}
    	.site-header {
    		padding-bottom: 0;
    	}
    }

    Let me know if that doesn’t work,
    Sage

  • Unknown's avatar

    It does, thanks! The only problem is that scrolling down, if you have the fixed header, it changes the height, Is it possible to make it be always the same? And one last thing: the title is not in the center of the height anymore, how can I align it back?

  • Unknown's avatar

    That’s great!

    Replacing the code I gave you with this should fix those points:

    @media screen and (min-width: 896px) {
    	.primary-menu .menu-item {
    		margin: 0px;
    	}
    	.main-navigation .primary-menu .current_page_item > a, .main-navigation .primary-menu .current-menu-item > a, .main-navigation .primary-menu .current_page_ancestor > a, .main-navigation .primary-menu a:hover {
    		background-color: #3e69dc;
    		border-color: transparent;
    		color: #FFF;
    	}
    	.primary-menu a {
    		padding: 34px 10px;
    	}
    	.main-navigation {
    		margin-top: 0px;
    	}
    	.site-header {
    		padding-bottom: 0;
    	}
    	.scrolling .site-header {
    		padding-bottom: 0px;
    	}
    	.scrolling .main-navigation, .scrolling .site-branding {
    		margin-top: 0;
    	}
    	.site-branding {
    		margin-top: 0px;
    	}
    }

    Hope that helps,
    Sage

  • Unknown's avatar

    Absolutely PERFECT! Thank you so much!

  • Unknown's avatar
  • The topic ‘Appearance of header menu’ is closed to new replies.