Background Image

Permalink
Hello,

I am building a website using the Elemental Theme. He has asked me to add a background image in the body. I don't remember any more how i did it, and i cannot find it, but it seems that i followed the instructions onhttps://www.concrete5.org/documentation/how-tos/designers/use-attrib... and now i have a background image that it is repeating to cover the whole body. I would like instead not to repeat and to stretch.

Which file should i edit? I found in a forum to use body {no-repeat } but i am not sure this is right. Can anyone suggest?

Thank you

 
Steevb replied on at Permalink Reply
Steevb
Try:
<?php 
$backgroundImage = $c->getAttribute('background_image');
if ($backgroundImage) {
    $backgroundImageURL = $backgroundImage->getURL();
    echo '<style type="text/css">body {background-image:url(' . $backgroundImageURL . ');background: no-repeat fixed;background-size: cover}</style>';
}
?>
admin replied on at Permalink Reply
Thank you! But on which file?
admin replied on at Permalink Reply
I assumed that i need to put it in concrete/themes/elemental/elements/header.php before </header>

but it did not work.
admin replied on at Permalink Best Answer Reply
Eventually i found the solution to be very simple. instead of adding it to the background, i added it to the layout using the concrete5 editor