How do I align text to the center in HTML ?

Hey guys new here and just learning HTML. I am currently on "HTML attributes" and learning to align text to the center of the screen using the tag. <p align="center" This is the text > </p>. Tried several times on the code playground sometimes copying exactly what it is in the example but the text just stays on the left hand side on the output screen. Can anyone help. Thanks Newbie

24th Dec 2017, 12:47 PM
4 Answers
+ 1
the tag should be like that <p align="center">This is the text</p> not <p align="center"This is the text></p>
24th Dec 2017, 1:17 PM
Mohammed Hany
Mohammed Hany - avatar
+ 1
<p align="center"> this is the text </p> Have you tried like this? the way you wrote there, the text is inside the syntax and it's not correct
24th Dec 2017, 1:16 PM
Welliton Malta
Welliton Malta - avatar
Ah found the problem. Cheers guys.
24th Dec 2017, 1:51 PM
That's what I have Still not working. Can other tags affect it? Or it's not supported in HTML?
4th Apr 2020, 10:16 PM
Keyshawn Jones
Keyshawn Jones - avatar