This is not a good article. Whoever is a beginner and tries to do this, will fail. You're leaving out of context a lot of things and even if I go and edit your code on codepen, I can see that removing margin or adding margin doesn't center anything vertically. What gives the vertically centered view of the text is your padding on the .center class and the margin of the p tag, not adding margin:auto. Please at least try out your own code before you post an article.
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is not a good article. Whoever is a beginner and tries to do this, will fail. You're leaving out of context a lot of things and even if I go and edit your code on codepen, I can see that removing margin or adding margin doesn't center anything vertically. What gives the vertically centered view of the text is your padding on the
.center
class and the margin of the p tag, not addingmargin:auto
. Please at least try out your own code before you post an article.