PDA

View Full Version : Background Tiling



NeoDreamer
January 9th, 2007, 10:58 AM
How do you get the background to start tiling from the right rather than the left (the default)? I suppose it has something to do with CSS...

[] represents a whole tile. [ or ] represents a portion of a tile cut off because the window wasn't wide enough.

Default:

[][][][][
[][][][][
[][][][][
[][][][][

What I want:

][][][][]
][][][][]
][][][][]
][][][][]

fasterthanlight™
January 9th, 2007, 11:21 AM
body{
background-image: url(myTile.jpg);
background-position: right;
}

NeoDreamer
January 9th, 2007, 12:35 PM
thanks

what if it was a table cell?

fasterthanlight™
January 9th, 2007, 12:51 PM
styling the tr or td?

NeoDreamer
January 9th, 2007, 01:18 PM
td

fasterthanlight™
January 9th, 2007, 03:22 PM
just apply the code i gave you to the td in your css



<div id="myTable">
<table>
<tr>
<td>
Something
</td>
</tr>
</table>




#myTable td
{
background-image: url(blah.jpg);
background-position: right;
}


That was off the top of my head dunno if itll work

NeoDreamer
January 9th, 2007, 08:45 PM
This code is correct in that it starts from the right. But somehow the vertical alignment is wrong. Is there a way to set the vertical starting point?

http://www.designaxe.com/temp.gif

fasterthanlight™
January 9th, 2007, 08:54 PM
yea, pick the one that you want:

{background-position: top;}

{background-position: center;}

{background-position: bottom;}

And you can do multiples like so:

{background-position: top left/right;}

{background-position: center left/right;}

{background-position: bottom left/right;}

Esherido
January 9th, 2007, 09:17 PM
You can also modify it's starting position: background: url(background.jpg) repeat 4px -20px;