The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › How to center align icon inside button?
https://www.w3schools.com/code/tryit.asp?filename=FTCZIK9F0A66
How to center align icon inside button?
Text-align:center or line-height:50% not working. How can fix it ? Thank you.
You’re using flexbox on the modal, so use the properties available to you
.modal-content { align-items: center; justify-content: center; }
That will center the button (no need to use margin at all).
Centering the X is trickier since you’ve changed the font-size so it’s not related to the size of the circle….but that’s another issue.
X