Forum Discussion

tavasjn24's avatar
3 years ago

Styling Custom Content

Does anyone know how I can add a classname to manipulate the styling of custom content? Currently I can add classnames to the title and the content but when I inspect the page the parent div tag is just empty and so I can't change any of the style.

  • Hi,

    You can use HTML with inline style in the custom content in admin. It works.

    Can you share the exact content of your custom content here if you still need help? And have you made custom components to display the custom content?

    • tavasjn24's avatar
      tavasjn24
      Guide

      So I was able to use Inline styling for the title and the content. I am trying to style the two divs. The parent div of the title and content doesn't have a classname or styling or a way to add in line styling. I can send a screenshot of the inspected content. 
      Additional question you mentioned using custom content in a custom component how would I accomplish that? I am just using custom content in a category page currently but I would like to know how to add custom content to a custom component.

       

      • jeffshurtliff's avatar
        jeffshurtliff
        Boss

        Hi tavasjn24,

        It sounds like you have two options.

        First, if you just wanted to wrap the custom content in a CSS class then you can add the wrapper attribute to the component in your quilt, as shown below.

        <component id="custom_content_1" wrapper="my-spiffy-class"/>

         

        Alternatively, if you wanted to call your custom content within a custom component and then just put that component in your quilt instead, then you could create a component that looks like the example below.  (This example assumes you're wanting to render Custom Content #3.)

        <div class="my-spiffy-custom-component">
          <div class="my-spiffy-content">
            <@component id="custom_content_3"/>
          </div>
        </div>

         

        Hope this helps.