how to center a heading in html Using the <center></center>
tags and Using a style sheet property Example with demo.
<center>Center this text!</center>
how to center a heading in html
How to set Heading alignment in HTML?
index.html
<!DOCTYPE html> <html> <head> <title>HTML Document - www.pakainfo.com</title> </head> <body> <h1 style="text-align:center">Tutorial</h1> <p>Learn for free</p> </body> </html>
How to center text in HTML
Example
<p style="text-align:center">Welcome To Pakainfo.com</p>
Multiple blocks of text
<style> p { text-align:center } </style>
using class
<style> .center { text-align: center } </style>
<p class="center">Welcome To Pakainfo.com</p>
I hope you get an idea about how to center a heading in html?.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.