View Full Version : moving background


Buffy
11-17-2003, 04:53 AM
Does the second pixel amount not mean moving the background down vertcally? Because if it is it's not working for me. I want to moved the bg down a bit.

<STYLE TYPE="text/css">
BODY {background-image:url(HTTP://www.chaosdream.co.uk/images/bg7.

gif); background-repeat:repeat-y; background-position:380px 150px;}
</STYLE>

kittycat
11-17-2003, 09:47 PM
I think the first one is vertical and the second is horizontal. Is the background image moving at all?

Buffy
11-17-2003, 11:34 PM
it moved horizontally only

MaGiCSuN
11-18-2003, 03:59 PM
I think it doesn't works because your background is tiled vertically, so it has no use to position it vertically because it's allready tiled that means it just has to fill the screen.

if you tile the image horizontally (repeat-x) then the vertical position code will work but the horizontal won't. You can solve this out with absolute positioning a table with that image as a background and then set it as the bottom layer. But then again, if your image is bigger then 1024x768 (not size, but screenresolution) you will get the horizontal scrollbar. Your code could be something like this:

<table border="0" cellspacing="0" cellpadding="0" style="background-image:url(HTTP://www.

chaosdream.co.uk/images/bg7.gif); background-repeat: repeat-y; position: absolute; top: 380px;

left: 150px; height: 100%; width: 100%; z-index: 0;"><tr><td>&nbsp;</td></tr></table>

you can mess a bit with the height and width of the table, and with the absolute positioning part offcourse.. :) but you can seeif you copy and paste the code above the bottom scrollbar appears... but then again i don't know if the numbers are right so :)

Love,
Mirna

Buffy
11-18-2003, 05:05 PM
Thank you very much I will play about with that :)

Buffy
11-18-2003, 09:57 PM
I'm trying to do it like you said with the tables, except I Couldn't get it in the right place at all so I split the background up in to two seperate images. A background image for each cell. But I'm still getting errors. For example the background for the first cell isn't showing. And I can't get the content in the second cell to go in the right place.

Here is the url: http://www.chaosdream.co.uk/index3.php

Here's my table:

<table border="0" cellpadding="6" cellspacing="10" position:
absolute; top: 120px; left: 362px; height: 100%; width: 100%; z-
index: 0;">
<tr>
<td valign="top" align="left" width="373" style="background-image:url(HTTP://www.chaosdream.co.uk/images/bg7a.gif); background-repeat: repeat-y; position: absolute; top: 120px; left: 362px;">
<font face="arial" color="ffffff" size="1">
main. main. main. main. main. main. main. main. main. main. main.
main. main. main. main. main. main. main. main. main. main. main.
main. main. main. main. main. main. main. main. main. main. main.
main. main. main. main. main. main. main. main. main.
</td>
<td valign="top" align="left" width="194" style="background-image:url(HTTP://www.chaosdream.co.uk/images/bg7b.gif); background-repeat: repeat-y; position: absolute; top: 120px; left: 768px;">
<?php

include ("http://www.chaosdream.co.uk/content.php");

?>
</td>
</tr>
</table>

Can you possibly point out where I've gone wrong?