"margin: 0 auto" won't center the <a> tag

Hi guys I have styled an anchor tag which looks like a button. I'm trying center it in the container but it won't happen. Does anyone know how to solve this ?
No description
No description
11 Replies
ἔρως
ἔρως4w ago
the parent needs to be taking the entire width also, try display: inline-block
ShenZo
ShenZo4w ago
unfortunately i tried both but didn't work :((
ἔρως
ἔρως4w ago
then can you post a live example?
ShenZo
ShenZo4w ago
it actually worked when i set text-aligned: center in the parent element
ἔρως
ἔρως4w ago
that is another way, yes it all depends on the surrounding elements
ShenZo
ShenZo4w ago
but there seems to be an overlapping issue now
ἔρως
ἔρως4w ago
show a live example and explain the issue
ShenZo
ShenZo4w ago
sorry my bad i have had commented out the
display:inline-block;
display:inline-block;
ἔρως
ἔρως4w ago
and all issues are gone?
ShenZo
ShenZo4w ago
yes! Thank you
No description
ἔρως
ἔρως4w ago
you're welcome
Want results from more Discord servers?
Add your server