Published on

Making Titles and Prices Dance in Harmony on Your Shopify Collection Page

Authors
  • avatar
    Name
    Entaice Braintrust
    Twitter

Making Titles and Prices Dance in Harmony on Your Shopify Collection Page

Okay, so picture this: I’m sitting in my quaint little home office, sipping a cup of tea that’s maybe—just maybe—too strong for mere mortals. It's the kind of day where everything feels just a tad off-kilter, a bit skewed to one side, like the Leaning Tower of Pisa wearing a stylish beret. It was then that a friend messaged me in distress about a quirky mishap on their Shopify store. "The text!" they lamented, "It's like a conga line gone wrong – titles leaning left and prices swaying right on the phone view!"

Now, dear reader, let’s embark on a delightful journey as we unravel the textile tangle of misaligned text on a Shopify mobile view. Our mission: to make those titles and prices dance in synchronized bliss as they should.

The Great Alignment Adventure

First things first, we embark upon this quest by opening the mystical portal - or, more commonly known as Shopify Admin. There’s a little thrill, like opening a magical book and stepping into a land filled with clickable wonders. Our aim? The Code Editor, of course! It’s the sacred scroll where we sprinkle a bit of digital magic.

1. Navigate to the Code Editor

Start by logging into Shopify. Take a moment to appreciate how modern technology allows us to tackle such challenges without donning armor or wielding swords. From your Dashboard, find that ‘Online Store’ tab on the left and sigh contentedly. Here, select ‘Themes’ and hit ‘Actions’ next to your current theme, which most likely needs your affection. Within a dropdown menu, the words ‘Edit Code’ appear like a beacon of hope. Click it.

2. The Hunt for the Right Files

Now, this bit is crucial in our narrative. Finding the right file is like trying to locate that single sock devoured by the laundry gods. But worry not! Our quarry lurks closer than you think. In the ensuing file structure labyrinth, dive into the ‘Sections’ folder on the left. You might encounter many files, but you’re seeking ones like collection-template.liquid or similarly named blueprints of your collection pages.

3. The CSS Chronicles

To fix misaligned text, we must write a few lines in the silent, yet oddly conversational language of CSS - think of this as having a brisk dialogue with the fabric of the webpage itself. Scroll down to your file (or perhaps it’s stashed away in assets as a .css file), and this is where the sorcery happens, type the following:

@media (max-width: 768px) {
  .grid-product__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px; /* just in case you wanna space it out stylishly */
  }
}

What does this do? In simple terms, this compels your title and price to acknowledge each other’s presence and align respectfully on phones.

4. Marvel at Your Masterpiece

Remember Bob Ross? How he’d joyously declare a project complete with a cheerful smile? We're reaching that moment. Having saved your changes, visit your Shopify store on a phone—go on, bask in the glory of a job well done. Your titles and prices should now stand in harmonious procession, displaying the kind of neatness that only the tidiest of souls might dream of.

Relishing the Triumph

The end? Perhaps for now. Grab another cup of that strong brew and feel like a digital wizard who’s tamed a beast. Smile knowing that your text and prices twirl perfectly on that collection page under the mini spotlight of a phone screen. We did it, together, sharing in this small triumph over the pixels and codes that once confounded us.

And remember, next time things seem misaligned, or if your world feels as wonky as a lopsided cake, know that a few lines of code (or a call to a helpful friend) might just fix everything. Onward, to more adventures!