Full justify a portion of Rich Text block in Dawn theme

Full justify a portion of Rich Text block in Dawn theme

siric
Shopify Partner
26 1 12

Hi,

 

I have a Rich Text block which is centre justified by default.  I would like the first line to be centre justified and then the remainder to be full justified.

 

I have seen answers which speak to assigning the css code to the rich-text component, but I do not want it to apply to the whole block.

 

How can I get this done?

 

Thanks

Steve

Replies 3 (3)

saim007
Shopify Partner
611 75 108

@siric See CSS code is working on whole block you are using Rich Text block by default it is justified but you want only first line then you must be use HTML block instead of Rich text block then your desire result will be possible with the help of tags and class you can set the alignment for each and every line.

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
siric
Shopify Partner
26 1 12

Thanks, but I do not see an HTML block only Rich Text

 

siric_0-1721739366733.png

 

saim007
Shopify Partner
611 75 108

Hi @siric Go to Edit Code > Click on Section tab and create new section and write any name as you like and paste below code. 

 

<div>
  {{ section.settings.custom_html | raw }}
</div>

{% schema %}
{
  "name": "Custom HTML Block",
  "settings": [
    {
      "type": "html",
      "id": "custom_html",
      "label": "Custom HTML",
      "default": "<p>Enter your custom HTML here.</p>",
      "info": "Add any HTML content you want to display."
    }
  ],
  "presets": [
    {
      "name": "Custom HTML",
      "category": "Custom"
    }
  ]
}
{% endschema %}

Now go to customization > search for the HTML block you will find that block and you can enter your content with html tags.

Let me know if you need any help!

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂