Welcome Guest ( Log In | Click here to Register a free account now! )
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.![]() ![]() |
Jun 5 2006, 11:28 PM
Post
#1
|
|
![]() Forum Regular ![]() ![]() ![]() Group: Members Posts: 245 Joined: 27-May 05 From: 127.0.0.1 Member No.: 21,516 |
How to make a Horizontally Centered Box with XHTML/CSS Guide Overview The purpose of this guide is to show how a horizontally centered box can be achieved utilizing XHTML and CSS. The following example uses no tables and validates according to W3C standards. As is, this model is compatible with all modern browsers. Instructions
body { margin: 100px 0px; padding: 0px; /* Set margin and padding for cross browser consistency. */ text-align: center; /* Needed for IE5/Win */ } #content { width: 75%; margin: 0px auto; /* Right and left margin set to "auto", to center the box horizontally */ text-align: left; /* Needed to counteract IE5/Win alignment problem */ padding: 15px; border: 1px solid #000; background-color: #eee; }
-------------------- When I'm right, I'm right....
And when I'm wrong, I could have been right.... So I'm still right, cause I could have been wrong. |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 7th September 2008 - 05:41 PM |