Hello! I’m creating my first online store, and I needed help creating this button. I used this code below but it makes the text appear to the right of the icon and then misaligns everything. Can you help me? Thanks

.header__icon--cart:after {
content: "Itens";
position: relative;
font-size: 14px;
}
Preview link: https://umhw5c-2w.myshopify.com/?_ab=0&_fd=0&_sc=1
Pass: mahpor
If you’re adding “Itens” using :after, it can mess up alignment because it’s just tacked on with no layout control. One trick is using flexbox on the cart icon wrapper to fix that — quick and clean.
I’ve handled this for a few store owners before. There’s a better way to keep everything aligned depending on your theme setup. If you’re open to it, I can take a closer look and walk you through what would work best. Just shoot me a message.
1 Like