text-align:left;right;center;justify;
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>CSS Example</title>
<style type='text/css'>
body {
color:#000000;
background-color:#ffffff;
font-family:arial, verdana, sans-serif;
font-size:12px;}
div {width:500px;margin:10px;}
.leftAlign {text-align:left;}
.rightAlign {text-align:right;}
.center {text-align:center;}
.justify {text-align:justify;}
</style>
</head>
<body>
<h1>text-align</h1>
<div class="leftAlign">Here is some left-aligned text</div>
<div class="rightAlign">Here is some right-aligned text</div>
<div class="center">Here is some centered text</div>
<div class="justify">Here is some justified text, this example requires at least three lines of text so that you can see the true effect that the justify property has. Here is some text, this example requires at least three lines of text so that you can see the true effect that the justify property has.</div>
</body>
</html>
Related examples in the same category