473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How to center a DIV with CSS

Page In Question: http://www.saqsi.com/index.php

I cannot manage to center the contents of DIV page-complete so that all DIVs whole-page and skyscraper look centered on the page. That is appear in the middle.

What is wrong please? It is driving me crazy.
Expand|Select|Wrap|Line Numbers
  1. #complete-page {
  2.     position: absolute;
  3.     left: 0px;
  4.     right: 0px;
  5.     top: 0px;
  6.     width: 100%;
  7.     margin: auto;
  8. }
  9. #whole-page {
  10.     Z-INDEX: 139;
  11.     float: left;
  12.     BORDER-RIGHT: #cccccc 1px solid;
  13.     PADDING-RIGHT: 0px! important;
  14.     PADDING-LEFT: 0px! important;
  15.     PADDING-BOTTOM: 0px! important;
  16.     margin: auto;
  17.     MARGIN-TOP: 5px;
  18.     BORDER-LEFT: #cccccc 1px solid;
  19.     WIDTH: 750px;
  20.     PADDING-TOP: 0px! important;
  21.     BORDER-BOTTOM: #cccccc 1px solid;
  22.     POSITION: relative;
  23.     BACKGROUND-COLOR: #fff;
  24. }
  25. #skyscraper {
  26.     float:left;
  27.     padding: 5px;
  28.     width:120px
  29. }
  30.  
Mar 5 '10 #1
2 2029
Niheel
2,460 Expert Mod 2GB
Try this:
Expand|Select|Wrap|Line Numbers
  1. #complete-page {
  2. left:0;
  3. margin:auto;
  4. right:0;
  5. text-align:center;
  6. top:0;
  7. width:910px;
  8. }
  9.  
Basically you had 100% width, which we changed to 750(content)+160(sky) = 910px and absolute postioning.
Mar 5 '10 #2
Thanks fixed it! Thanks a lot for the code and the explanation. I really appriciate it and my head is less worry free now.

Thanks to lot to you and this website.
Mar 5 '10 #3

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

Similar topics

7
by: Alex | last post by:
Hi Everone, I need some advice on how to setup 4 columns where the outside two are absolute (120px) and the inner two (side by side) are relevent (Fluid) and change with the screen. Here's my...
3
by: Mike | last post by:
Another complaint I would like to see corrected. The Information Center tool is now pretty much useless to me. Does anyone else besides me remember when information center had a troubleshooting tab...
2
by: Claude Shea | last post by:
Is DB2 Development Center an addon product that I have to download or purchase separately? I can't seem to find it in any of my downloads or on any of my CDs. Is it available for all versions of...
1
by: Henry Reardon | last post by:
I have been having problems with the Development Center for several days now. It seemed to be working fine when I initially installed DB2 (LUW) Version 8 (FP7) and upgraded to FP8, except that I...
4
by: Joey | last post by:
Does anyone know how to center this sample webpage in Firefox? If so, will you provide the example as it applies to this sample webpage? I have read numerous posts and articles on how to center...
1
by: judacris | last post by:
I've seen the threads here about molding 2 divs in a centered fashion. but I can't seem to solve this thing. my blogger blog is functioning well on my site for now, but the blog feed (left) and...
24
by: GloStix | last post by:
I'm trying to center this banner, it's in a div that has the same width so it's not exactly "centering" but it's screwed up, It works in safari but in Firefox it's messed up. I uploaded a Video to...
2
by: yangtono | last post by:
Hi, I am creating a table to list some data. The table is using a sorting and highlight function that I found from the net. I can't attach image here, basically html will wrap the heading,...
14
by: gaijinco | last post by:
I was a hobbist web coder for years but I had to sidestep for a while. Now I'm trying to return to it and I'm trying to clarify how am I supposed to do somethings with CSS v.s. HTML and I'm...
13
by: Stevo | last post by:
I've found that for IE6+, if you add the property text-align:center to a DIV, then *anything* inside it gets centered. That can be a table, an object/embed, another DIV, an image, or some text. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.