Forum Moderators: not2easy
1) Centering the <div>
2) Centering the text within the <div>
These are two very different things. Below is a sample that does both.
NOTE: There are multiple options for centering the <div> It might be better in some situations to use the value 'auto' - {margin: 0 auto;}
Note: There is no 'pagetext-align' in the W3C recommendations. 'text-align:' is correct.
W3C - text-align [w3.org]
Validate your code for HTML and CSS. If it does not validate, errors should be fixed first. And code in FF or Opera, then fix for IE. Working in IE does not tell you much.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>
</title>
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
.center {
margin: 7em 15% 0 15%; text-align: center; font-size: 1.5em; border: .1em solid #000; padding: .5em;
}
</style>
</head>
<body>
<div class="center">
CENTERED
</div>
</body>
</html>