- By using markup language, HTML is used to design webpages.
- It defines the link between the webpages.
- It defines the structure of webpages where markup language is used to define the text document within tag.
- In required format HTML is used by the browser to manipulate text, images, and other content to display.
- By using the text-align property, we can change the alignment of the text.
- We can align the text in the Left, Right and Center.
- The text alignment can be done with HTML Attribute tag and Cascade Style Sheet.
- In Webpage, HTML allows the use of these CSS to perform changes in the style of the content.
Align text to left
Sample Code
[pastacode lang=”markup” manual=”%3C!DOCTYPE%20html%3E%0A%3Chtml%3E%0A%3Cbody%3E%0A%0A%3Ch1%20style%3D%22text-align%3Aleft%3B%22%3EWelcome%20to%20Wikitechy%3C%2Fh1%3E%0A%3Cp%20style%3D%22text-align%3Aleft%3B%22%3EHi%20this%20is%20Venkat%20.%3C%2Fp%3E%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A%0A” message=”” highlight=”” provider=”manual”/]Output

Align text to Right
Sample Code
[pastacode lang=”markup” manual=”%3C!DOCTYPE%20html%3E%0A%3Chtml%3E%0A%3Cbody%3E%0A%0A%3Ch1%20style%3D%22text-align%3Aright%3B%22%3EWelcome%20to%20Wikitechy%3C%2Fh1%3E%0A%3Cp%20style%3D%22text-align%3Aright%3B%22%3EHi%20this%20is%20Venkat%20.%3C%2Fp%3E%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A%0A” message=”” highlight=”” provider=”manual”/]Output
Align text to Center
Sample Code
[pastacode lang=”markup” manual=”%3C!DOCTYPE%20html%3E%0A%3Chtml%3E%0A%3Cbody%3E%0A%0A%3Ch1%20style%3D%22text-align%3Acenter%3B%22%3EWelcome%20to%20Wikitechy%3C%2Fh1%3E%0A%3Cp%20style%3D%22text-align%3A%20center%3B%22%3EHi%20this%20is%20Venkat%20.%3C%2Fp%3E%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A” message=”” highlight=”” provider=”manual”/]Output


