views:

28

answers:

2

hi, I'm putting together a sprite and have two questions.

Something I've always wondered whether possible is negatively positioning a background picture to the right or bottom. A negative position is bread and butter stuff on the left of an element or top but what about the right and bottom?

If I have a 500px by 500px div can I then position the left edge of a background image to appear 5px in from the right using a negative value rahter than 495px to push it over?

The second question is whether I can use just a small portion of an image and repeat it without the rest of the image showing.

For example, I may have a sprite thats 300px square and filled with all kinds of things. Is it possible to take a 50px square portion of that image and repeat it in the background of an element?

I very much doubt either is possible but must put the monkey to sleep!

A: 

The background-position property has a few different values:

left top
left center
left bottom
right top
right center
right bottom
center top
center center
center bottom

You can also specify X and Y positions for it. For more information on it, take a look at this link:

http://www.w3schools.com/css/pr_background-position.asp

As for your second question, that's not possible using simple CSS.

Tyler
A: 

For your first question, no you cannot.

For your second question, no you cannot.

babtek