How can I specify background color and image for a block or node? My web page consists of vertically aligned blocks. Each of these blocks/nodes may have  a custom background color or image. I am entering the background color/image within the specific block. How can i then apply these CSS attributes on that specific block? I would like to simply render the block as

&lt;section id="dlazdice" style="background: {{ field.bgr_color }} url('{{ field.bgr_image }}')"&gt;
[...]
&lt;/section&gt;


I played with block template but was not able to persuade the color or image attribute to appear where i needed them, both the values were wrapped in the useless

&lt;div class="field".../&gt;


markup.
You can do it with this module:
https://www.drupal.org/project/bg_image_formatter

Just upload image as background field and set the class in the field settings for which element you want to display image as bgd.
It works with Views as well. So, for example, you can use Views conditional module and create a block and test if bdg field is empty and then create different styles with bgd color in that case.