Jun 29, 2012, by admin
Do you want to center your website content to create equal sized borders to the left and right but want the text to remain left necessary? Read on!
<html>
<head>
</head>
<body>
</body>
</html>
<style type=”text/css”>
body
{
margin: 0;
padding: 0;
padding-top: 10px;
text-align: center;
}
#centered
{
width: 800px; /* set to desired width in px or percent */
text-align: left; /* optionally you could use “justified” */
border: 0px; /* Changing this value will add lines around the centered area */
padding: 0;
margin: 0 auto;
}
</style>
<div id=”centered”>
</div>
<html>
<head>
<style type=”text/css”>
body
{
margin: 0;
padding: 0;
padding-top: 10px;
text-align: center;
}
#centered
{
width: 800px;
text-align: left;
border: 0px;
padding: 0;
margin: 0 auto;
}
</style>
</head>
<body>
<div id=”centered”>
<h1>My Website</h1>
<p>
blah…blah…blah…
</p>
</div>
</body>
</html>