Archived topic
Float contact info to the right of main navigation
5 replies · Started by Lucy on April 3, 2022
Hi there
I've added a generate_after_primary_navigation hook to add some contact information to the navigation bar. It will hold social icons and a phone number but for now you can just see where it says 'Test' in black to the right of the main navigation:
https://wordpress-613164-2329556.cloudwaysapps.com/
I've set it to float right and I've set the inner navigation width to be 'Full' via the Customiser but it's still constrained to the centre.
I can see that if I set the Navigation Alignment to Left then the test text floats right as required but I want the navigation to remain in the centre.
Thank you,
Lucy
Hi Lucy,
I’ve set it to float right
Which setting do you mean?
It looks your navigation location is set to above header not float right.
Go to customizer > layout > primary navigation, set Navigation Alignment to rightinstead of center.
I've set the content in the generate_after_primary_navigation hook to float-right using CSS.
I don't want the Navigation to be aligned right - I was the navigation to remain in the centre but the bit of text in black that currently says "Test" to float to the far right.
Thanks
Lucy
So you want the navigation to be in the center and the test on the right?
The navigation is using Flexbox structure, so float:right; won't work.
You'll need to position it with position: absolute;, try this CSS:
.header-contact-info {
position: absolute;
right: 20px;
}
That's great, thank you. All working now.
You are welcome :)