Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > RocketCake
how to centre the navigation menu?

ivarforkbeard
Registered User
Quote
2021-03-16 21:19:30

Is there a way to centre the navigation menu? It seems to always be left justified?


erik
Registered User
Quote
2021-03-17 20:34:27

Select it and click on the "center text" button, that should do the trick. To make it look more centered, make its background invisible and put it centered into a container. Then set the color of the container to the one you like it to have.


ivarforkbeard
Registered User
Quote
2021-03-18 22:29:12

That doesn't seem to do it quite right. I think I have to manually adjust the width in px on the container, and then centre the container, but there doesn't seem to be a way to have the nav menu set to just keep all the options centred, even after you add or remove some...


niko
Moderator
Quote
2021-03-19 08:12:04

Try the "Nature Water" template (the first one) in RocketCake. That navigation menu is centered, and it's done exactly as erik described. Doesn't this work for you?


ivarforkbeard
Registered User
Quote
2021-03-19 12:44:04

Yes, but if you add another item to that menu, it will be truncated, because the nature water navigation menu is specifically set at 336, 34 for sizing.

Otherwise I have to add items, then estimate how wide they are and keep adjusting the width of the menu to fit what I've put up as options...

I was expecting (maybe too high an expectation? It's easy for me to imagine what I want!) that I would be able to just add items as needed, and it would have an "automatic" width and be able to keep all the items centred, much as if I were simply typing text that I had set to always be centred.

Does that make more sense?

Just wait until my next round of questions!


ivarforkbeard
Registered User
Quote
2021-03-21 23:39:10

I'm getting closer!

If on the navigation menu itself, I edit the HTML and add some CSS like so:

display: block;
margin-left: auto;
margin-right: auto;
width: 940px;

I can get it to centre itself without it having to be in a another container. About the only thing left is to figure out how to pad it out to 100% so that the background doesn't show at each end.

Cheers!


ivarforkbeard
Registered User
Quote
2021-03-23 13:37:49

Just talking to myself here, or a future person wanting to do the same... I noticed that by forcing my menu to be 940px, that causes the weird effect on mobile of having a blank scrollable area off to the right. I was able to correct this issue by simply setting the Max-Width of the menu to be 100%. I guess when it switches to mobile, it ignores my block command. Sweet.

As for the bigger picture, I also think I have another solution to centre a navigation menu AND have it cover 100% of the width - just make a navigation menu that's manually populated for mobile and empty for everything else. Then fill the rest of that container with small text boxes and just link the boxes individually. Don't even really use the navigation menu built-in to RocketCake...

Sorry if I'm rambling. I just want to pay forward anything I discover to the next person.


niko
Moderator
Quote
2021-03-23 16:10:49

Yes, basically best is to set a width at which it is best to switch to the mobile menu and then use just that. Other more complex dynamic swtiching can be achieved like you try to, I guess, but it's more complicated as you see.
Will see if I can improve the navigation menu a bit into that direction for the next major update.


ivarforkbeard
Registered User
Quote
2021-03-25 00:21:56

Sounds great! I know I figured out the sticky navigation so it doesn't have to start at the top, but maybe you could add that as an option in properties for future versions so people wouldn't have to do the CSS tricks - it seems like there has been some interest in that ability.


holistic_tony
Registered User
Quote
2021-04-03 20:12:41

Yes, I know this has been a thorn in my side for months. It's one of many inadequacies in Rocketcake, honestly.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact