Center the primary-menu in the one-page template

4 replies · opened Apr 5, 2016

JjuanchpApr 5, 2016

Hello good afternoon,
I need to include in the primary-menu in the one-page template (index-onepage-2.html) another logo in the right side, and make the ul menu list centered, is it possible?

Thanks!
Juan Carlos

SSemicolon WebSTAFFApr 6, 2016

Hello,

This is certainly possible however some Customized Code will be required. Please follow the steps below to apply this to your Header:

  • Add the following CSS Code preferably in the css/custom.css File and link this CSS File in your header as described in the Documentation > Start > Customization Section:
@media (min-width: 992px) {
	#primary-menu {
		float: left;
		max-width: none;
		text-align: center;
		line-height: 0.85;
	}

	#header.full-header #primary-menu > ul {
		display: inline-block;
		float: none;
		text-align: left;
		border-right: 0;
	}

	#logo-2 {
		position: relative;
		float: right;
		font-family: 'Raleway', sans-serif;
		font-size: 36px;
		line-height: 100%;
		margin-left: 40px;
	}

	#header.full-header #logo-2 {
		padding-left: 30px;
		margin-left: 30px;
		border-left: 1px solid #EEE;
	}

	#logo-2 a {
		display: block;
		color: #000;
	}

	#logo-2 img {
		display: block;
		max-width: 100%;
	}
}
  • Add the following JS Code at the bottom of the Page just after the js/functions.js File Linking:

	function primaryMenuResizer() {
		var mainLogo = jQuery('#logo').outerWidth(),
			secondLogo = jQuery('#logo-2').outerWidth(),
			containerWidth = jQuery('#logo').parent('.container').width(),
			primaryMenu = jQuery('#primary-menu'),
			primaryMenuWidth = containerWidth - ( mainLogo + secondLogo + 60 );

		if( jQuery('body').hasClass('device-lg') || jQuery('body').hasClass('device-md') ) {
			primaryMenu.css({ 'width': primaryMenuWidth });
		} else {
			primaryMenu.css({ 'width': '' });
		}
	}

	jQuery(window).load( function(){
		primaryMenuResizer();
	});

	jQuery(window).resize( function(){
		primaryMenuResizer();
	});
  • Now you can simply add the following HTML Code for the Second Logo in the #header Container just after the #primary-menu Container:

	[
![attachment](images/logo.png)
](index.html)

This will definitely work fine. Let us know if we can help you with anything else or if you find any further issues.

JjuanchpApr 6, 2016

Ei looks great! And very fast reply Thanks you so much... only some details:

The code for the second logo inside the #header container, After the #primary-menu tag? or inside it before the </nav> tag?

The second logo does not resize as the first logo (and the line also does not resize when you navigate in the page).

Thank you so much!
JC

JjuanchpApr 6, 2016

A sample

JjuanchpApr 7, 2016

Hello,
Sorry for this but I changed the design of the menu for other. The example is in the (index.html) canvas 4.0.1, where the background is transparent in the top of the page, but when the user scroll down the screen the logo change to black. How can I make this in this situation? With the second logo in the right side of the page?

Thanks and sorry for this
JC

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard