<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I customize a section background color along with background image? in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/711962#M31092</link>
    <description>&lt;P&gt;welcome to Hubspot!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 29 Oct 2022 20:45:38 GMT</pubDate>
    <dc:creator>squatchcreative</dc:creator>
    <dc:date>2022-10-29T20:45:38Z</dc:date>
    <item>
      <title>How do I customize a section background color along with background image?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/700448#M30684</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm in the page editor, and am finding it very difficult to add a `background-image` at the same time as a `background-color` to my current section. My desired CSS output would look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;background-image: url("path-to-image.svg");&lt;BR /&gt;background-color: #ff9900;&lt;/PRE&gt;&lt;P&gt;but the page editor only lets me choose either a color or an image, but not both.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bg-color-image.jpg" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/76257i69B28F7F52C2E5B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="bg-color-image.jpg" alt="bg-color-image.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How can I declare both color and image in the same section so it can be used with transparency?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was looking at making my own custom section template, but when &lt;A href="https://developers.hubspot.com/docs/cms/hubl/tags/dnd-areas#dnd-section" target="_blank" rel="noopener"&gt;looking at the documentation&lt;/A&gt;, I see that it says:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;Please note:&lt;/STRONG&gt; you can only use one background parameter per dnd_section tag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So how can I let my users customize `background-color` and `background-image` simultaneously? Surely it can't be too hard, it's practically trivial to do this via CSS. I must just not be finding it.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 05:42:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/700448#M30684</guid>
      <dc:creator>marquizzo</dc:creator>
      <dc:date>2022-09-30T05:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I customize a section background color along with background image?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/700483#M30687</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/452794"&gt;@marquizzo&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;in my opinion you got several ways you can go:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create your whole section/row as a custom module since this will give you better control over the settings. You'll lose the drag&amp;amp;drop functionality but you could create it very specific, what would make the life of your content creators easier since you can predefine everything in the module and they have to put the content into it.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;create a "configuration" module. By doing this you'll keep all the drag&amp;amp;drop functionality&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here some examples&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;section module:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;- add all of your wanted functions like rich-text, images ... as functions&lt;/P&gt;
&lt;P&gt;- for the background add an image function in the top part or an background image in the style-tab in the right sidebar&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your HTML+Hubl section should look like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{# start styling #}
{% require_head %} {# adding this to your module will push everything between into the head-tag #}
&amp;lt;style&amp;gt;
section.customSection.{{ name }}{
background: url('module.style.background_image.src'), rgba({{ module.style.background_color.color|convert_rgb }},{{ module.style.background_color.opacity/100 }} );
}
&amp;lt;/style&amp;gt;
{% end_require_head %}
{# end styling #}

{# start module #}
&amp;lt;section class="customSection {{ name }}"&amp;gt; {# adding {{ name }} will add the modules name as class which will give you individual style settings per module if you're placing it several times on a single page #}
&amp;lt;div class="container"&amp;gt;
&amp;lt;div class="row"&amp;gt;
&amp;lt;div class="col-12 col-md-6"&amp;gt;
{{ module.rich_text }}
&amp;lt;/div&amp;gt;
&amp;lt;div class="col-12 col-md-6"&amp;gt;
&amp;lt;img src="{{ module.image.src }}" alt="{{ module.image.alt}}" class="customSectionImage"&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/section&amp;gt;
{# end module #}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;configuration module&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;basically the same as above with a small difference: If you want to have a bit more flexibility and use this module for several sections - you need only a simple text(not rich-text) for your given class&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{# start styling #}
{% require_head %} {# adding this to your module will push everything between into the head-tag #}
&amp;lt;style&amp;gt;
.{{ module.css_class }}{
background: url('module.style.background_image.src'), rgba({{ module.style.background_color.color|convert_rgb }},{{ module.style.background_color.opacity/100 }} );
}
&amp;lt;/style&amp;gt;
{% end_require_head %}
{# end styling #}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to work with the configuration module?&lt;/P&gt;
&lt;P&gt;When you set a class somewhere, you'll write it in the text element of the configuration module and it will apply the styling to this class&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hope this helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 07:08:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/700483#M30687</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2022-09-30T07:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I customize a section background color along with background image?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/700556#M30690</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/452794"&gt;@marquizzo&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;&amp;nbsp;suggested sure works, but I also wanted to point out another way of doing this that we are currently using&amp;nbsp; for our own website : using theme sections.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LMeert_0-1664531471139.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/76273i5E59561930442F5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="LMeert_0-1664531471139.png" alt="LMeert_0-1664531471139.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use hubl to create dnd sections and add a custom class to each of them.&lt;/P&gt;
&lt;P&gt;Then simply create a css file and style your sections using regular CSS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the screenshot above, you can see a quite lengthy list of sections that we have predefined so our users can vary the flow of the pages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's how adding a theme section to a page looks like :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LMeert_1-1664531727022.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/76274iD8AA9FBF538976F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="LMeert_1-1664531727022.png" alt="LMeert_1-1664531727022.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One other cool thing you can do with this method is automatically style the content of your modules based on the background color by preceding all your relevant css selectors with the section custom classes you create.&lt;/P&gt;
&lt;P&gt;You can &lt;A href="https://drive.google.com/file/d/1gU2KM2LKdzYewflpzsgZdkRWx02YpY88/view?usp=sharing" target="_blank" rel="noopener"&gt;find here a video&lt;/A&gt; showcasing moving modules around having the text color adjust to the section background color.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps !&lt;BR /&gt;If it does, please consider marking this answer as a solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Ludwig&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 10:01:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/700556#M30690</guid>
      <dc:creator>LMeert</dc:creator>
      <dc:date>2022-09-30T10:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I customize a section background color along with background image?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/700809#M30696</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the thorough answer! I cannot believe that such a simple CSS rule needs such a complicated workaround in Hubspot.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 18:51:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/700809#M30696</guid>
      <dc:creator>marquizzo</dc:creator>
      <dc:date>2022-09-30T18:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I customize a section background color along with background image?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/711962#M31092</link>
      <description>&lt;P&gt;welcome to Hubspot!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Oct 2022 20:45:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/711962#M31092</guid>
      <dc:creator>squatchcreative</dc:creator>
      <dc:date>2022-10-29T20:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I customize a section background color along with background image?</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/1062160#M41112</link>
      <description>&lt;P&gt;I'm attempting to add a class attribute for the backhround image but allow content editors to change the color. This is not possible because hubspot uses a linear gradient for solid color backgrounds in case a content editor wants to get spicy:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-10-29 at 9.00.26 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/130425iE84012F120CAA6C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-10-29 at 9.00.26 AM.png" alt="Screenshot 2024-10-29 at 9.00.26 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So even if the &lt;A href="https://developers.hubspot.com/docs/cms/hubl/tags/dnd-areas#background-color" target="_blank" rel="noopener"&gt;background_color property&lt;/A&gt;&amp;nbsp; and not the background_linear_gradient is defined, hubspot says "let's define a backhround image property so they can't have color and an image". Unfortunately, creating multiple sections with the backhround color and image defined with a class selector is the only way to go.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 16:13:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-do-I-customize-a-section-background-color-along-with/m-p/1062160#M41112</guid>
      <dc:creator>EdCupaioli</dc:creator>
      <dc:date>2024-10-29T16:13:45Z</dc:date>
    </item>
  </channel>
</rss>

