Advertisement

Alignment of titles

General questions relating to Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
Tinchus
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Jun 12, 2024 2:55 am

Alignment of titles

Post by Tinchus » Mon Jun 24, 2024 9:07 pm

Hello all, sorry for the newbie question. I used the search and found many post but related to very old versions of joomla (back to 2010 like so...)

When I post modules, the module title is left aligned. I have not found a way to make it right or centered. I see that there is an advanced tab in the module configuration and there I can see a "class CSS" field and many other options. Maybe I need to specify some css class there ?

If not or any information and help somebody can provide me would be great.

Thanks in advance

Advertisement
webmasterab
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Sun Sep 24, 2017 12:49 pm

Re: Alignment of titles

Post by webmasterab » Mon Jun 24, 2024 9:13 pm

If you have Google Chrome.
Then take a look with the inspector.
Here you can adjust the CSS, or try it.
If all goes well, you can copy this code into your user.css, or the place where you can put your own css.
This way it becomes an override.
https://developer.chrome.com/docs/devtools/css

Tinchus
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Jun 12, 2024 2:55 am

Re: Alignment of titles

Post by Tinchus » Mon Jun 24, 2024 9:22 pm

Thank you for the answer. Sadly, I dont use chrome. And the answer looks liek a little complicated for my level maybe. The edition you mention of user.css would modify all the aligment of all the titles in the hole website? my intention is to be able to choose if I want a title to be left, center o right aligned. is that posible in joomle or I have to choose 1 of the 3 aligments for the hole site?

webmasterab
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Sun Sep 24, 2017 12:49 pm

Re: Alignment of titles

Post by webmasterab » Mon Jun 24, 2024 9:44 pm

I now understand your question better.

EDIT:
It can be even simpler.

Further on the advanced tab is header class
If you use this
you just need in your css .header {
color: red;
text-align: left;
}

to override the title.
Is easier

End edit

What you can then do is use the CSS classes.
This is per module.

Create a class in the user.css or where you can place your own css.

in the module on the advanced tab
set up a module class.
As an example I did a test.

In the css you then create .test .g-title {
text-align: left !important;
}

In my screenshot you can see what you have adjusted in the yellow section.
The green is then overwritten
module 1.png
module 2.png
You do not have the required permissions to view the files attached to this post.

Tinchus
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Jun 12, 2024 2:55 am

Re: Alignment of titles

Post by Tinchus » Mon Jun 24, 2024 9:51 pm

Im on the way I guess but still not clear to me , sorry :(
Where Im suposed to create
.test .g-title {
text-align: left !important;
}
?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 31151
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Alignment of titles

Post by Per Yngve Berg » Tue Jun 25, 2024 4:03 am

For the Cassiopeia Template, put it in user.css

Tinchus
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Jun 12, 2024 2:55 am

Re: Alignment of titles

Post by Tinchus » Tue Jun 25, 2024 10:43 am

Thanks for the answer. This is what I did but with no good result:
I added the file user.css on the CSS folder of the template (using the web interface)
in hta file I copy and paste this:

.test .g-title {
text-align: center !important;
}

Saved. The on the site modules I choosed the module that shows 3 articles. In that module configuration in section advanced, I added "test" on both "module CSS class" and "header CSS class". Saved, then reloaded the website. I dont see a change on the alignment of the module titles.

SI of course I did something wrong?

webmasterab
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Sun Sep 24, 2017 12:49 pm

Re: Alignment of titles

Post by webmasterab » Wed Jun 26, 2024 7:36 am

Which template do you use?
Because you have to create the CSS override there somewhere.
Too bad it hasn't worked yet.
We continue until happiness is

Tinchus
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Jun 12, 2024 2:55 am

Re: Alignment of titles

Post by Tinchus » Fri Jul 05, 2024 11:46 am

Im using Cassipeia. I cresated the file user.css, as I posted above, so of course Im doing something wrong?
Anyu help is preciated, thanks in advance

Advertisement

Post Reply

Return to “General Questions/New to Joomla! 4.x”