Home
CSS
CSS Align
Tryit: Center align text
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> .center { text-align: center; border: 3px solid green; } </style> </head> <body> <h2>Center Text</h2> <div class="center"> <p>This text is centered.</p> </div> </body> </html>