I am new to Joomla. I am trying to customize the Article title. As per my understanding the title is using Header tag h2, now this is same across all the Articles displayed on the site. So basically if I change the header tag for 1 it changes all. I have an article with Title ASK YOUR QUESTIONS Now I want to add a background to this specific title only without changing the others. Please let me know how can I achieve this?
2 Answers
You can add a class to an article by going to its menu item, selecting Page Display
and entering the class name under Page Class
.
If you enter the name "test", the class name will be of the format "item-pagetest". Note that this class appears around the article rather than the whole page, though your H2 tag is most likely going to be within it unless you have an elaborate template.
You can then style the H2 tag with CSS along the lines of:
.item-pagetest h2{
color:#f00;
}
-
Richard B : maybe you can precise where to put these lines. I would suggest user.css if using protostar. Go to Extensions -> Templates, then Templates (on the left), -> Protostar Details and Files -> CSS -> New File, click CSS again just in case. Then choose CSS in the dropdown menu Select File Type and choose user.css as the file name. The file will be automatically loaded.Put your CSS here.– jcm69Jul 6, 2017 at 20:38
-
This will only work if the Article "ASK YOUR QUESTIONS" is linked to by a menu item. I'm still in the habit of adding a space in front of the class name so any styling linked to the default page class is not affected:– BodgeITAug 4, 2017 at 12:49
i think you just need to add a special class for this title and style for this class. It's enough for your problem.