How to create a line break in Subheading for Zest theme?

How to create a line break in Subheading for Zest theme?

spasister
New Member
9 0 0

I cannot add a line break using <br> in the subheading for Zest theme. How can I do this? 

Replies 2 (2)

Sweans
Shopify Partner
406 80 124

Hi @spasister ,

In Shopify themes, including the Zest theme, certain text fields like subheadings may not support HTML tags like <br> directly. However, you can try adding a line break using CSS or by modifying the theme's code. Here's how:

Method 1: Using CSS

 

.subheading-class::after {

    content: "\A"; /* This adds a line break */

    white-space: pre; /* This makes sure the line break is rendered */

}

 

Replace .real-subheading-class with the actual class name of your subheading element.

 

Method 2: Modify Theme Code

Go to Online Store > Themes > Actions > Edit code.

locate the file of subheading and try this code.

 

 

<h2>{{ 'Your Subheading Text' | replace: ' ', '<br>' }}</h2>

 

 

I hope this helps! If not, please provide url of website.

If it does, please like it and mark it as a solution! 

If you need further assistance, feel free to reach out!

Regards,
Sweans

- Was my reply helpful? Please Like and Accept the Solution or let me know by Buying me coffee!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me at [email protected] regarding any help.
- To know more about me check out www.sweans.com

spasister
New Member
9 0 0

Hi Sweans, I'm not able to find "Subheading". Here is my URL (in preview mode): https://q8yg7oy2djj1wm9t-27013598.shopifypreview.com