Forum Moderators: open
The solution also depends on the above and if you require the div to maintain specific dimensions while retaining a centered position (example - width:400px) or if the div needs to be fluid in a simple horizontal placement.
If it is the former then Tedster's supplied resource might be the best solution; if you require a horizontal-centered liquid div, then margin settings will accomplish this:
.centered-div {
margin-right:5%;
margin-left:5%;
}
Of course you can adjust the percentages as suited to your use.
#content { margin-right: 15%; margin-left: 15% }
#textblock { font-size: 16px; line-height: 20px; font-family: "Courier New", Courier, Monaco }
<div id="content">
<div id="textblock"></div>
</div>
Very similar to papabaer's suggestion, only it allows the textblock div to have its own separate background color/pattern, etc., to create the look of a 70% width "box" floating in the center of the screen.