SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : HTML and CSS :

Previous DiscussionNext Discussion
 CSS Center on Page

I have been trying to center an element (mainDiv) on a page and can't figure out why it will not center.  I do have some elements in the 'hdrDiv" that have some absolute positioning and don't know if that could be causing the problem.

Please point me in the right direction.

Thanks

John

body

{

background-color: #5d7d60;

text-align:center;

font-family: Arial, Helvetica, sans-serif;

font-size: 12px;

min-width: 800px;

}

.mainDiv

{

width: 800px;

padding: 0px;

top: 0px;

margin: 0px auto;

text-align:left;

}

.hdrDiv

{

width: 800px;

padding: 0px;

height: 201px;

z-index: 2;

}

/*Header Positioning*/

/*Row 1*/

.upperLeft

{

position: absolute;

top: 10px;

left: 50px;

}

.centerTop

{

top: 10px;

left: 298px;

height: 108px;

position: absolute;

}

.upperRight

{

position: absolute;

top: 10px;

left: 497px;

}

/*Row 2*/

.leftCorner

{

position: absolute;

top: 118px;

left: 0px;

}

.products

{

position: absolute;

top: 118px;

left: 84px;

}

.details

{

position: absolute;

top: 118px;

left: 175px;

}

.about

{

position: absolute;

top: 118px;

left: 497px;

}

.contact

{

position: absolute;

top: 118px;

left: 617px;

}

.lowerRightSpacer

{

position: absolute;

top: 118px;

left: 712px;

}

/*Row 3*/

.leftSide

{

position: absolute;

left: 0px;

top: 154px;

right: 765px;

}

.leftSpace

{

position: absolute;

top: 154px;

left:82px;

}

.rightSide

{

position: absolute;

top: 150px;

left: 710px;

width: 92px;

height: 61px;

}

.bottomRight

{

position: absolute;

top: 154px;

left: 497px;

}

/*Row 4*/

.bottomCenter

{

position: absolute;

top: 191px;

left: 298px;

}

Started By john1506 on Jun 1, 2010 at 1:30:45 PM

5 Response(s) | Reply

View All Replies
bikramrig on Jun 19, 2010 at 9:18:05 PM

Whats the difference between Absolute and Relative positioning ? Can you explain it by example, till date it is not very clear to me

WhyInsure
Income Protection Insurance Australia


View All Replies

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2000 InsideDHTML.com, LLC. All rights reserved.