Cassiopeia: how to center items in Main Menu? Topic is solved

Everything to do with Joomla! 4.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
bmassaer
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Sun Jul 26, 2015 7:34 pm

Cassiopeia: how to center items in Main Menu?

Post by bmassaer » Fri Sep 30, 2022 9:46 pm

In the Main Menu of Cassiopeia, I would like to align the menu-items centrally; now they are aligned left. I read that I should add "center" after class suffix, but I cannot find this option.
How can I align the menu items centrally?

www.thegoosething.com

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 13100
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Cassiopeia: how to center items in Main Menu?

Post by sozzled » Fri Sep 30, 2022 9:53 pm

What menu? I don't see any menu(s) at that URL.
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
:)

bmassaer
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Sun Jul 26, 2015 7:34 pm

Re: Cassiopeia: how to center items in Main Menu?

Post by bmassaer » Fri Sep 30, 2022 10:00 pm

The "main menu" is with the logo "The Goose Thing". I would like to have it centered.
I will add more menu items so it's more clear!

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 13100
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Cassiopeia: how to center items in Main Menu?

Post by sozzled » Sat Oct 01, 2022 12:23 am

I spent about 30 minutes experimenting with CSS to obtain what you have asked for but I had to give up. I wasn't happy with any of the approaches that I tried working with the way you've arranged things at your website. I'm sure it's possible to get what you want using Cassiopeia but you'll have to be patient and either (a) try something yourself, or (b) wait for someone else to offer you suggestions.
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
:)

User avatar
ceford
Joomla! Ace
Joomla! Ace
Posts: 1382
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Cassiopeia: how to center items in Main Menu?

Post by ceford » Sat Oct 01, 2022 2:21 am

You can't do what you want using the method you are trying. You should convert the logo-wit.jpg image to an svg and use it in place of the Cassiopeia logo (it should have been a png rather than a jpg image). Then use a two item menu and don't bother trying to put the items on either side of the logo.

I suppose you could use three modules side by side, two separate menu modules on either side of a module containing the logo. You will need a better grasp of css!

User avatar
Maradona
Joomla! Intern
Joomla! Intern
Posts: 94
Joined: Fri Aug 30, 2013 2:08 pm

Re: Cassiopeia: how to center items in Main Menu?

Post by Maradona » Sat Oct 01, 2022 5:33 am

Is this what you're trying to achieve? :-[



:pop
CENTER.png
You do not have the required permissions to view the files attached to this post.

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 13100
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Cassiopeia: how to center items in Main Menu?

Post by sozzled » Sat Oct 01, 2022 5:41 am

That's brilliant, @maradona, but it's not quite right. @bmassaer, add these lines to the end of your user.css:

Code: Select all

.container-nav {
    justify-content: center !important;
}
That's all you need.
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
:)

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 13100
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Cassiopeia: how to center items in Main Menu?

Post by sozzled » Sat Oct 01, 2022 9:22 am

I thought this was so good to know, I wrote this up as an article. :)
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
:)

bmassaer
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Sun Jul 26, 2015 7:34 pm

Re: Cassiopeia: how to center items in Main Menu?

Post by bmassaer » Sat Oct 01, 2022 11:48 am

You ar brilliant indeed! Thank you so much...
Bart

User avatar
Maradona
Joomla! Intern
Joomla! Intern
Posts: 94
Joined: Fri Aug 30, 2013 2:08 pm

Re: Cassiopeia: how to center items in Main Menu?

Post by Maradona » Sat Oct 01, 2022 5:46 pm

sozzled wrote:
Sat Oct 01, 2022 9:22 am
I thought this was so good to know, I wrote this up as an article. :)
Can we have the link to the article? :)

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 13100
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Cassiopeia: how to center items in Main Menu?

Post by sozzled » Sat Oct 01, 2022 6:57 pm

@maradona: I'm not permitted, under the forum rules, to post links to the articles I write—it would be called "self-promotion"—but it you might find it on Twitter. ;)
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
:)


Post Reply

Return to “Templates for Joomla! 4.x”