different background colors for pages

Permalink
Hello all,
I have a site with a many pages with each a different color. I'm struggling to assign a color other than specified in default. I'm aware of using the background class in the header. But that requires to have for each page an addl. header.
Is there an easier way? Thank for hinting.

 
PineCreativeLabs replied on at Permalink Reply
PineCreativeLabs
One way to do this might be to use a page attribute to define a color for that page. There's a free color picker attribute addon here:
https://www.concrete5.org/marketplace/addons/colorpicker-attribute...
You could then use that attribute and programmatically assign it's value as the background color.
blinkdesign replied on at Permalink Reply
blinkdesign
Not as elegant as PineCreativeLab's solution, but simple.
Put this line of HTML in "Extra Header Content" of the page where you want a different background color.
<body style=background-color:blue;>


Adjust "blue" to your desired colour. Use hex values.
JohntheFish replied on at Permalink Reply
JohntheFish
Please check with View Source.
I suspect that will give you 2 body tags in the page.
(Elements in dev console may hide that from you)

You would need to add a <style> </style> section in a header extra content attribute with similar rules to implement this approach.
blinkdesign replied on at Permalink Best Answer Reply
blinkdesign
Thanks JohntheFish for your close attention.

Correct, one needs to add the following code to avoid two <body> tags:
<style>
body {background-color:blue;}
</style>

Also true, the console hides it.
With the <style> tag you can add rgb and hex values.
hammermedia replied on at Permalink Reply
Thank you all. Header Extra Content worked for me.
Martin