PDA

Click to See Complete Forum and Search --> : Horizontal center div absolute images


animeonmymind
06-03-2007, 11:45 AM
Hello,

I just finished creating my website in Imageready slices (it's a complete desk with all objects on it to act as links) but now I want to center the whole thing but that doesn't seem to work =/ I have made a linked stylesheet with all my images defined like this

div.id01 {
position:absolute;
left:0px;
top:0px;
width:172px;
height:54px;

my entire css file is like that but no matter what I try to do I can't seem to center my site it always sticks to the left side =s

I've used this:

body {
text-align: center;
}

div.wrapper {
text-align: left;
margin-left: auto;
margin-right: auto;
}

None of it helps:confused: I have to submit this assigment for school on thuesday so I only have 2 days left to get and center the whole thing ...

Would you guys please help me out on the one =(?

Thanks !

JPnyc
06-03-2007, 12:12 PM
Well without seeing the structure, I'm only guessing, but did you try removing

position:absolute;
left:0px;
top:0px;

animeonmymind
06-03-2007, 12:45 PM
Well the code I gave was not the complete one. Here's a bit of the rest

div.Table_01 {
position:absolute;
left:0px;
top:0px;
width:1024px;
height:700px;
}

div.id01 {
position:absolute;
left:0px;
top:0px;
width:172px;
height:54px;
}

div.Newspaper-01 {
position:absolute;
left:172px;
top:0px;
width:193px;
height:164px;
}

div.id03 {
position:absolute;
left:365px;
top:0px;
width:358px;
height:16px;
}

div.Sketchbook1 {
position:absolute;
left:723px;
top:0px;
width:264px;
height:198px;
}

div.id05 {
position:absolute;
left:987px;
top:0px;
width:37px;
height:451px;
}

div.id06 {
position:absolute;
left:365px;
top:16px;
width:332px;
height:11px;
}

So you see, after using slices the images were positioned with CSS so if I remove the left and top all the images will be scrambled =/

animeonmymind
06-03-2007, 12:51 PM
Thanks for the replies, I've solved the problem ;-) It was indeed the left & top

Real Thanks