How To Position Text in the Center of the Screen
How To Position Text in the Center of the Screen Using HTML
So, this script is not perfect, but it's fine for some things.
OK, so this tutorial uses HTML and CSS, so you're gonna need to make a new HTML, CSS, JS repl. You can delete the
Let's make the text we want centered, like this:
class so that way we know that it is that text we want centered, nothing else.
Now, in our style.css:
margin: 0 will make sure the text is right at the edge, not any further into the page, because this can mess up our code.
First, let's make sure the x position is aligned (x position is sideways).
Awesome! We got ourselves some alignment! Not the most aligned, but good enough.
How do I change the size of my text, without ruining the alignment?
(Actually, it's a little hard)
1. Change the size by the amount you want to change it by.
2. Change the
padding-top by NEGATIVE the amount you changed the size by.
PRO TIP: If you want the text smaller, do the opposite of the text.
Still confused? Go put that in the comments, and I'll be happy to respond!