Move product rating to the same line as the title

Solved

Move product rating to the same line as the title

btwu10
Excursionist
18 0 8

Rating.png

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?

Accepted Solution (1)

tim
Shopify Partner
4274 488 1572

This is an accepted solution.

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);
}

Screenshot 2025-04-05 at 8.41.56 PM.png

Screenshot 2025-04-05 at 8.42.12 PM.png

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com

View solution in original post

Replies 2 (2)

Maxleontech
Tourist
7 0 1

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;
}
```

tim
Shopify Partner
4274 488 1572

This is an accepted solution.

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);
}

Screenshot 2025-04-05 at 8.41.56 PM.png

Screenshot 2025-04-05 at 8.42.12 PM.png

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com