A user is attempting to add horizontal divider lines between products in their Shopify cart drawer. Their initial code snippet only produced a red dot instead of a full-width line.
Problem Details:
The original markup code created a red dot rather than the desired horizontal line separator
The user wants lines between items but not after the last item (to avoid duplication with the existing footer line)
Solutions Offered:
Multiple community members provided CSS-based approaches:
First suggestion: Use width: 100vw instead of percentage-based width
User rejected this as it caused unwanted horizontal scrolling
Alternative approach: Add CSS targeting .cart-drawer .cart-item with border-bottom property
Initial version added lines under all items including the last one
Final solution: CSS code that adds borders between items while excluding the last item using :last-child selector with border-bottom: none
Includes !important flags to ensure style precedence
Addresses both requirements: lines between items and no line after the final item
The discussion includes screenshots demonstrating the visual results of each solution.
Summarized with AI on November 2.
AI used: claude-sonnet-4-5-20250929.
Hello, Iβm trying to add a horizontal line in between products in my card drawer, so I added this code:
{%- unless forloop.last -%}
---
{%- endunless -%}
But it just adds a red . in between the products and not a full line like the default top and bottom horizontal line. Does anyone know how I can show a horizontal line there?
Hello @websensepro , this code makes my card horizontally scrollable which I absolutely do not want.
Hello @Moeed the code you provided also adds a horizontal line under the last cart item which I do not want since there is already a horizontal line under it aswell for the footer.