View Full Version : Why doesn't it work?


Combat Babe
08-07-2004, 03:42 AM
Ok, I'm trying to code my new layout, and I was under the impression that adding the tag <div align="center" valign="middle"> was supposed to align it in the vertical and horizontal center of the page, but it isn't vertically aligning it at all. What am I doing wrong?

Monkey Bizzle
08-07-2004, 03:49 AM
that doesn't work... i asked that question too once upon a time and no one could seem to figure it out... but then, i came across this thread...

http://www.lissaexplains.com/forum/showthread.php?t=59167

it seems that the only way to do it is by putting your things in a small table...

Combat Babe
08-07-2004, 03:56 AM
oh, ok. I already have it in a one-celled table anyway so I can use relative positioning. Thanks.

Combat Babe
08-07-2004, 04:12 AM
um that didn't work. Also, I have a div layer that is supposed to go over the image, and it is under it. Why is that? And why hasn't it centered at all?

http://www.erstwhilemoments.belike.net/ (http://www.erstwhilemoments.belike.net)

Monkey Bizzle
08-07-2004, 04:19 AM
in this...

style="position: relative; top: 65; left: 85; height: 375; width: 305; scrolling: auto;"

try putting px after all the numbers...

Monkey Bizzle
08-07-2004, 04:25 AM
grr... too late to edit... change relative to absolute... i did that to your code and it moved "hello" to the top LH corner... you will have to change the numbers tho... !

also... here... i will just paste the code... i viewed your source and edited it...

<html>
<head>
<title>Erstwhile Moments</title>
</head>
<body background="http://www.erstwhilemoments.belike.net/images/layout/wall.gif">

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr>

<td align="center" valign="middle">

<img src="http://www.erstwhilemoments.belike.net/images/layout/corkboard.jpg" width="875" height="565"
border="no">
<div align="justify" style="position: absolute; top: 65px; left: 85px; height: 375px; width: 305px;
scrolling: auto;">

<p>Hello.</p>

</div>

</td>

</tr>
</table>
</body>
</html>

the image is now centered in the page and if you change the numbers in the absolute positioning that you will be good to go!

Combat Babe
08-07-2004, 04:28 AM
no, nothing happened. :crying:

I even tried putting the image in a div layer and set the z-indexes to 1 and 2, but nothing changed. I don't know what's wrong!

It still isn't centered, but I noticed that the text in the div is centered under the image. I don't know what that means though...

EDIT: Oh wait, too late. Let me try what you did.

EDIT AGAIN: Nope, it centers it good, but the text is on the wood, and I want it on the peice of paper. And with absolute positioning, won't it make it look different in different resolutions, since I'm centering it?

Monkey Bizzle
08-07-2004, 05:04 AM
okay, it won't look different on different resolutions... as long as you position EVERYthing that you want to absolute position from the left and the top... so, you should change the numbers like i said before and it should work... keep moving it down and over to get it off the wood

Combat Babe
08-07-2004, 05:09 AM
I figured out that you said I'd have to change it, I just didn't think of it, and it was too late to edit again. yeah, but then it wouldn't be perfectly centered in every resolution either. and that bothers me, because when it comes to web design, I'm a perfectionist. maybe I'm just too picky, but I really want it perfect.

kittycat
08-07-2004, 05:24 AM
Did you try using position:relative instead? That should position it from the left corner of the table... although it may not because of the image in there, but you could easily set that as a background image.
You could try playing around with the top and left margins as well, instead of positioning. eg margin-top: 65px; margin-left: 85px;

Monkey Bizzle
08-07-2004, 05:27 AM
she originally had relative and it put it under the table... and since you have that wall image as the BG... i don't think you can make your corkboard the BG too... what you could do however, if you want to get into it a little bit more... is slice the image and put it back together with a table... and then whichever part of the notepaper that you want the text, you could put the text in that part of the table... and just so you know, i use 1024 res and i can see the whole thing fine but i switched to 800 x 600 to test the absolute positioning and you have to scroll all over to see the whole thing...

Combat Babe
08-07-2004, 05:37 AM
well, I should be able to set it as a cell background, so I'll try that. Slicing is too complicated. I tried it, but because nothings align perfectly since it's on a corkboard, it makes a bunch of slices, and I'd rather not do that. I do best with the least amount of code possible.

As for scrolling in 800x600, I forgot that. I originally had the image small enough, but made it too big when I added the wood frame. I'll just resize the image in photoshop, it isn't that big of a deal.

Combat Babe
08-07-2004, 05:45 AM
Yeah, it doesn't center the image when it's the cell background. I may have to slice the image. I hate to, but I will if I have to. But then how do I keep the whole table centered?

EDI:Oh wait, I found a way to center it. Now I just need to figure how to get the div layer where I want it.

Monkey Bizzle
08-07-2004, 05:51 AM
well, i wish you luck and your corkboard thing is so neat! so i hope that it works out!

Combat Babe
08-07-2004, 05:58 AM
OH IT WORKS!!!!! Thanks so much!!!! I had no idea you could position something with negative numbers....anyway Thanks for the compliment, and thanks for all your help!!!!

Now for the other two div layers...