Text align with style

In an html element, you can horizontally align the text using the style tag and its text-align property.

Example:

<html>
<head>

<title>Setting background color</title>

</head>
<body style=
"background-color:#dfdfdf ">

<p style= "text-align:center">This is the paragraph1 with center align</p>

<p style= "text-align:left">This is the paragraph2 with left align</p>

<p style= "text-align:right">This is the paragraph3 with right align</p>

</body>

</html>






This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.