Changing background colour of article

Everything to do with Joomla! 2.5 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.
Locked
John Oxlade
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 139
Joined: Wed Dec 22, 2010 2:03 am
Location: Whatawhata, New Zealand

Changing background colour of article

Post by John Oxlade » Fri Jun 15, 2012 6:13 am

In the official docs (http://docs.joomla.org/Put_a_background ... an_article) the code is given to change the colour behind an article. Actually, the

Code: Select all

<div style="background-color: #dddddd">
changes the colour behind the TEXT. Is it possible to change the colour of the whole article inside the border?
I have generated an Artisteer 3 template but would like to be able to apply a colour to specific articles on a page (so I can't have multiple templates as that'd apply to the entire page).
Is this possible?
Thanks,
John

User avatar
MrCodexCY
Joomla! Guru
Joomla! Guru
Posts: 510
Joined: Wed Nov 03, 2010 7:35 pm
Location: Limassol, CY
Contact:

Re: Changing background colour of article

Post by MrCodexCY » Fri Jun 15, 2012 6:16 am

Hello mate,

You need to check which div covers the whole field you would like to add a background. You can use firebug to check that, it will help you really much with that, and in the future.

~Artemis
Providing quality web design services since 2005!

Get direct Joomla! assistance, contact me on skype: mrcodexcy

John Oxlade
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 139
Joined: Wed Dec 22, 2010 2:03 am
Location: Whatawhata, New Zealand

Re: Changing background colour of article

Post by John Oxlade » Fri Jun 15, 2012 6:33 am

Trying that now. It is not that straightforward. If you have a moment and don't mind, can you check: http://www.nzholistichealth.co.nz/index ... pip-oxlade and tell me what the div is around the article. I will then use Firebug to find the same thing so I know in future.
Thanks,
John

John Oxlade
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 139
Joined: Wed Dec 22, 2010 2:03 am
Location: Whatawhata, New Zealand

Re: Changing background colour of article

Post by John Oxlade » Fri Jun 15, 2012 6:42 am

I just tried art-post-body and it only changes the colour behind the text not right up to the border. Not sure if this is even possible to fix.

John Oxlade
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 139
Joined: Wed Dec 22, 2010 2:03 am
Location: Whatawhata, New Zealand

Re: Changing background colour of article

Post by John Oxlade » Wed Aug 22, 2012 9:30 pm

I sort-of fixed this. Adding:

Code: Select all

<div class="art-post-body" style="background-color: #f8daff;">
to the top of the article, and remembering to add:

Code: Select all

</div>
at the end puts a colourd background around most of the article - but I couldn't figure out how to fill the whole article with colour.
The other catch doing it this way is you cannot have a READMORE in the article otherwise the

Code: Select all

</div>
doesn't get processed and the border of the article goes on the fritz.


Locked

Return to “Templates for Joomla! 2.5”