Move product rating to the same line as the title

Topic summary

A user wants to reposition the product rating to appear on the same line as the product title, specifically to the right of it, while removing excess spacing between the title and description.

Two solutions were provided:

  1. HTML/CSS modification approach: Wrap both elements in a container div and use display: flex with align-items: center to align them horizontally.

  2. CSS-only solution (recommended): Use the theme’s “Custom CSS” setting to avoid direct code editing. This approach uses flexbox on the safe-sticky element with specific width calculations to position the title and rating side-by-side. The solution includes flex-wrap: wrap and CSS variables to control the rating width.

Screenshots demonstrate the CSS-only implementation showing the rating positioned next to the title. The discussion remains open with no confirmation of which solution was implemented.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

How do I move the product rating to the same line as the title? Specifically, how do I move it to the right of the title and remove the space between the title and description?

To move the product rating next to the title in Shopify Btwu

HTML

<div class="product-title-container">
<h2 class="product-title">{{ product.title }}</h2>
<span class="product-rating">{{ product.metafields.reviews.rating }}</span>
</div>

CSS

.product-title-container {
display: flex;
align-items: center;
}

You can do this with CSS and use “Custom CSS” setting of the section to avoid editing the theme code.

Try this custom CSS:

safe-sticky {
  display: flex;
  flex-wrap: wrap;
  --rating-width: 3rem;
}
safe-sticky > * {
  width: 100%;
}
safe-sticky > .product-info__title {
  width: calc(100% - var(--rating-width));
}
safe-sticky > .product-info__rating {
  width: var(--rating-width);
}