StevieB
StevieB

Reputation: 6533

CSS Background position top right add a margin?

So I have the following mark up :

    background: #7BC145 url(/images/ill_people_leadGen.png) no-repeat right top;

And its nearly perfect but i just want to add a bit of margin on top of the image, just wondering how I could add that to above.

Upvotes: 7

Views: 23244

Answers (4)

Bryan Downing
Bryan Downing

Reputation: 15472

background: #7BC145 url(/images/ill_people_leadGen.png) no-repeat right 10px;

Upvotes: 12

alf
alf

Reputation: 18530

Something like this?

background: #7BC145 url(/images/ill_people_leadGen.png) no-repeat 100% 5px;

Upvotes: 2

ianaldo21
ianaldo21

Reputation: 669

Just add margin-top:10px; to the same line background: #7BC145 url(/images/ill_people_leadGen.png) no-repeat right top; margin-top:10px;

Upvotes: 0

calebds
calebds

Reputation: 26228

Say you wanted 5 pixels of "margin":

/**                         replace 'top' with this vvv */
background: #7BC145 url("REDACTED") no-repeat right 5px;

Upvotes: 3

Related Questions