ajmajmajma
ajmajmajma

Reputation: 14216

css - background position (with slight padding?)

I am trying to emulate something like

 background-position: left center

With the exception that it is not actually flush with the left side, so like 5-10 px off the left side and center.

My first attempt was like so

 background-position: left 5px center

CSS does not seem to like that though, is something like this possible without messing with margins?

Thanks!

Upvotes: 0

Views: 129

Answers (1)

fabric1601
fabric1601

Reputation: 91

It is possible yes, and there are several ways.

and W3C have explained it pretty good over here (http://www.w3schools.com/cssref/pr_background-position.asp)

Scroll to the table of Property Values and read the description of the X and Y values or the Xpos and Ypos values.

in your case, I believe that it will be something like:

background-position: 5px center;

I hope this helps

Upvotes: 1

Related Questions