views:

66

answers:

2

hi, i got a issue, let say i want to display a background image for a link

                  |   words   |

the bars mean the start/end of the link, it doesn`t actually exist

and i want the background image display horizontally, but not start from the bar, and end at the bar,

i want it start 13px away from the left bar and 13px away from the right bar??

i know there is a background-position in css, but can i ask the background-position to specify the 13px for me???

A: 

I believe background obeys the padding and margin css styles, so you could set margin-left: 13px; and margin-right: 13px;.

psychotik
+2  A: 

The following code does what you need:

<style>
    .biglink {
        margin: 0 13px 0 13px;
        background: url('background.png') no-repeat center center;
    }
</style>
Anax