Center Menu in Cassiopeia

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
edk024
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Feb 20, 2013 11:53 pm

Center Menu in Cassiopeia

Post by edk024 » Sat Mar 25, 2023 3:40 pm

I want to center align menu items in the main menu. I tried adding this code to the user.css but no results.

.container-nav {
justify-content: center !important;
}
.navbar-brand {
margin: auto;
}

Any other way to accomplish this? Using Joomla 4.28

Mr. Wimpy
Joomla! Explorer
Joomla! Explorer
Posts: 390
Joined: Fri Dec 02, 2005 10:46 am
Location: The Netherlands

Re: Center Menu in Cassiopeia

Post by Mr. Wimpy » Sat Mar 25, 2023 4:10 pm

This is a bit difficult without an url...

Is the menu horizontal or vertical?
If horizontal you need to use align-items: center;

It's a flex thing. If flex-direction is set to column (=horizontal), align-items and justify-content are switched.

Else you could try the good old text-align: center;

edk024
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Feb 20, 2013 11:53 pm

Re: Center Menu in Cassiopeia

Post by edk024 » Sat Mar 25, 2023 5:22 pm

Tried both but no luck, still left aligned. Using the main menu module published in the menu position set to horizontal. No other changes to the template.

edk024
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Feb 20, 2013 11:53 pm

user.css changes not updating cassiopeia template

Post by edk024 » Sat Mar 25, 2023 9:40 pm

I created the file /media/templates/site/cassiopeia/css/user.css When I add a css option it does not update the template.
Last edited by imanickam on Sun Mar 26, 2023 6:03 am, edited 1 time in total.
Reason: Merged the topic https://forum.joomla.org/viewtopic.php?f=815&t=1000710 with https://forum.joomla.org/viewtopic.php?f=815&t=1000706. In the future, please do not create multiple topics for the same issue as it is against the forum rules.

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 8762
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: user.css changes not updating cassiopeia template

Post by AMurray » Sat Mar 25, 2023 10:16 pm

exactly what are you trying to update? Please provide the CSS you're trying to use, and the website link you're applying it to.

Try clearing browser and joomla caches. are you using a CDN like Cloudflare (or any other)?
Regards - A Murray

edk024
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Feb 20, 2013 11:53 pm

Re: user.css changes not updating cassiopeia template

Post by edk024 » Sat Mar 25, 2023 10:29 pm

I want to center align menu items in the horizontal main menu in the Cassiopeia template. I tried adding this code to the user.css but no results.

.container-nav {
justify-content: center !important;
}
.navbar-brand {
margin: auto;
}

Cleared everything / no CDN.

Mr. Wimpy
Joomla! Explorer
Joomla! Explorer
Posts: 390
Joined: Fri Dec 02, 2005 10:46 am
Location: The Netherlands

Re: Center Menu in Cassiopeia

Post by Mr. Wimpy » Sun Mar 26, 2023 7:47 am

I see I mixed up horizontal and vertical...
Not that it mattered...

Anyway...
Can you post the url so we can have a look at the code?


Post Reply

Return to “Templates for Joomla! 4.x”