473,468 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

centering divs in middle of screen

71 New Member
I've got a new site I'm working on. I'd like to give it the appearance that the page is centered in the middle of the screen, with white space on either side. Can anyone help me on how to handle this through the .css page? Any help would be greatly appreciated. Here's a link to the site: http://www.atlashvac.com/comfortteam/index.asp


here's the .css as I have it now:

/* css Indiana Comfort Team website default styles v1.01 */

body {
position: absolute;
left: 0px;
top: 0px;
margin: 0px 0px 0px 0px;
padding: 0px;
width: 100%;
height: 100%;
background-color: #006600;
}

/* ================================================== =================== */
/* Specific DIVs */
#banner {
position: absolute;
left: 0px;
top: 0px;
width: 1058px;
height: 150px;
voice-family: "\"}\"";
voice-family: inherit;
background-color: #FFFFFF;
z-index: 4;
}

#menu {
position: absolute;
left: 0px;
top: 150px;
width: 1058px;
height: 152px;
background-color: #FFFFFF;
z-index: 4;
}

#sidebar {
position: absolute;
left: 0px;
top: 302px;
width: 150px;
height: 100%;
background-color: #FFFF00;
z-index: 6;
}

#content {
position: absolute;
left: 150px;
top: 302px;
width: 908px;
height: 100%;
voice-family: "\"}\"";
voice-family: inherit;
background-color: #00CCFF;
z-index: 1;
}

/* ================================================== =================== */
/* Font Elements */

/* ================================================== =================== */
Apr 27 '07 #1
4 5152
rsteph
71 New Member
I actually got it to work in IE7, changing the positioning tab, and using the text-align trick. It doesnt' seem to be centered in Firefox though...
Apr 27 '07 #2
drhowarddrfine
7,435 Recognized Expert Expert
You will never get IE to pretend it's a modern browser like Firefox without a proper doctype. Right now you are in quirks mode. See the sticky at the top of this board. Use html4.01 strict. Then validate both your html and css for any errors.
Apr 27 '07 #3
rsteph
71 New Member
I've fixed all the bugs, but what would the proper doctype be for a .asp page? Would I just use the html doc type?
May 1 '07 #4
drhowarddrfine
7,435 Recognized Expert Expert
See the sticky at the top of this board about doctypes. The doctype is determined before any html is written and should always be strict. Whether it is created using asp or not does not matter.
May 1 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Duane Lambe | last post by:
On some suggestions from this group, I've started to turn my internal helpdesky site for our company to non-absolute positioning. I've been reading O'Reilly's CSS book, and several web sites and...
0
by: Olly | last post by:
I am using the following pure css layout with a header and footer: http://www.fu2k.org/alex/css/layouts/3Col_NN4_FMFM.mhtml The left column floats to the left of the main content (middle...
15
by: red | last post by:
How do I center two side by side divs ? I've been writing css pages for a while but there's one thing tha still eludes me. I can center a div with margin auto. I can place two divs side by side...
5
by: luke | last post by:
I need to have two different backgrounds, one on the left and one on the right of the screen, with the main content centered in the browser. This is the code I have come up with <table...
5
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
3
by: rsteph | last post by:
I'm using two divs to create a shadowed-box type effect. Within the top div I want to put an image. I can get the image to center right to left, but not top to bottom. I'm making a series of boxes,...
2
by: rudicheow | last post by:
SHORT VERSION ============= I have a bunch of identical fixed-size single-celled tables that rest against each other horizontally thanks to "float:left". These tables are dynamically generated...
2
by: TomTH | last post by:
I've written a program using a number of forms which runs perfectly on a 14" screen and you know the story....... on a bigger screen it all sits up in the top left hand corner. Ok I can scale it to...
1
by: yawnmoth | last post by:
I'd like to center two floated divs but am unsure of how to do so. Here's my code: http://www.frostjedi.com/terra/scripts/demo/div-float-center.html It seems like setting the width of the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.