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.
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.
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.
Adjust "blue" to your desired colour. Use hex values.
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.
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.
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.
Thanks JohntheFish for your close attention.
Correct, one needs to add the following code to avoid two <body> tags:
Also true, the console hides it.
With the <style> tag you can add rgb and hex values.
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.
Thank you all. Header Extra Content worked for me.
Martin
Martin
https://www.concrete5.org/marketplace/addons/colorpicker-attribute...
You could then use that attribute and programmatically assign it's value as the background color.