"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
ἔρως
ἔρως3mo ago
the parent needs to be taking the entire width also, try display: inline-block
ShenZo
ShenZoOP3mo ago
unfortunately i tried both but didn't work :((
ἔρως
ἔρως3mo ago
then can you post a live example?
ShenZo
ShenZoOP3mo ago
it actually worked when i set text-aligned: center in the parent element
ἔρως
ἔρως3mo ago
that is another way, yes it all depends on the surrounding elements
ShenZo
ShenZoOP3mo ago
but there seems to be an overlapping issue now
ἔρως
ἔρως3mo ago
show a live example and explain the issue
ShenZo
ShenZoOP3mo ago
sorry my bad i have had commented out the
display:inline-block;
display:inline-block;
ἔρως
ἔρως3mo ago
and all issues are gone?
ShenZo
ShenZoOP3mo ago
yes! Thank you
No description
ἔρως
ἔρως3mo ago
you're welcome
Want results from more Discord servers?
Add your server