- This topic has 9 replies, 3 voices, and was last updated 4 years, 1 month ago by
David.
-
AuthorPosts
-
February 18, 2019 at 2:41 pm #813985
Paul
Hi,
Is there a tutorial at all for creating a header like this: https://learnosity.com/
thanks
GeneratePress 2.2.2GP Premium 1.7.7February 18, 2019 at 4:21 pm #814048Leo
StaffCustomer SupportHi there,
I would recommend using this method:
https://docs.generatepress.com/article/navigation-as-a-header/You can use
menu-item-float-right
class to move certain items to the right:
https://docs.generatepress.com/article/adding-icons-to-menu-items/#floating-the-icon-to-the-rightThis should help for buttons:
https://docs.generatepress.com/article/adding-buttons-navigation/Shouldn’t need any widgets ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 19, 2019 at 2:46 am #814308Paul
Thanks Leo but that doesn’t really work.
I’m fine with buttons it’s getting the menu to sit next to the logo i’m struggling with.February 19, 2019 at 5:32 am #814428David
StaffCustomer SupportHi there,
could you share a link to your Site? You can edit your original topic and use the Site URL field for privacy.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 19, 2019 at 6:19 am #814473Paul
It’s not online right now but I’ve updated the OP with a link to a demo site that has the same header layout.
February 19, 2019 at 8:53 am #814753David
StaffCustomer SupportSo you would need to set the Nav as the header as per Leo’s instructions.
Then add this CSS:@media (min-width: 768px) { .main-navigation ul { display: flex; } .main-navigation li.force-right { margin-left: auto; } }
The first menu item you want sitting to the right ( e.g in the Learnosity site the Pricing item ) needs a CSS Class of
force-right
This will keep it and any subsequent menu items and the nav search to the right and all others will be pushed over to the left.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 19, 2019 at 9:27 am #814771Paul
That’s absolutely perfect David, thank you.
And thank you Leo for the initial info.I’ll be using this alot now.
I’d also like in future to create a similar layout but with the main nav centered, with a contact button to the right. So similar to this one you’ve helped me with but nav central instead of next to the logo. Would that be the same code but replacing “flex” in the css?
Once I have that figured out, with all the built in options and starter sites I think i’ve got every header layout I could ever need.
I love GP.
February 19, 2019 at 9:32 am #814775David
StaffCustomer SupportAwesome ๐
So using that above code you should be able to apply the same force-right class to the first menu item.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 19, 2019 at 10:13 am #814802Paul
Works perfectly, thanks very much.
February 19, 2019 at 10:32 am #814813David
StaffCustomer SupportGlad to be of help.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.