All things Shopify and commerce
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
@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.
Thanks, but I do not see an HTML block only Rich Text
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!
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025