Q&A
Ask and answer questions to make information more available to wider audiences.
Dominick Addy @addydominick   15, Jun 2023 12:00 AM
align text
How to align text in HTML?
answers 2
 
Answer 1
Aiden Barti @aidenbarti   22, Jun 2023 10:51 AM
Below is the code to align text in HTML: 

<!DOCTYPE html>
<html>
 <head></head>
<body>
<h1>Heading</h1>
 <p style="text-align:center/left/right/justify;">text</p>
 </body>
</html>

 
Answer 2
Aiden Barti @aidenbarti   22, Jun 2023 10:51 AM
HTML content is aligned on a page using the CSS text-align property. It sets the horizontal alignment of the content inside a block element or table-cell box. The text-align property works like a vertical-align but in the horizontal direction. It works on text and all other content inside the block element, such as images and buttons.