Log In · Register

 
Centering and entire DIV Layout
TehJusty
post Jan 10 2007, 11:14 AM
Post #1


Love at first sight
***

Group: Member
Posts: 72
Joined: Jan 2006
Member No: 365,246



Ok, so I kinda need help centering my DIV layout. I've searched already and there's been nothing too helpful. My only concern with centering a div layout is will it mess up the pixels? For instance here is one of my DIVs:
CODE
<div class="content" style="position: absolute;
left: 63px;  top:576px; width:220px; height:164px; overflow: auto; ">


Won't the pixel's interfere with that?

Maybe I'm asking a silly question but who knows.

Help por favor?
 
 
Start new topic
Replies
*WHIMSICAL 0NE*
post Jan 10 2007, 06:29 PM
Post #2





Guest






If you want to center your layout it won't mess with the pixels, unless you resize that div. That's what the pixels are (obviously). To center it you just change the location (top,left) of the div.

CODE
<div class="content" style="position: absolute;left:50%; top:0%;margin-left:XXXpx; margin-top:XXXpx;  width:220px; height:164px; overflow: auto; ">
Is the code to center the divs. You will have to mess around with the positioning because it starts from the middle, instead of the left like the paint programs.
 

Posts in this topic
TehJusty   Centering and entire DIV Layout   Jan 10 2007, 11:14 AM
WHIMSICAL 0NE   If you want to center your layout it won't mes...   Jan 10 2007, 06:29 PM


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: