CSS background-position calculated from left? I want it RIGHT -
i need allocate background image div, thing needs positioned right , not usual left in css. when defining background-position
, can read, , right, or big percentage (which calculated left side of screen anyway works) and.. that's it. cannot use pixels , go fix distance right side of container. right here? so, there work-around this? less if helps? theoretically, can have set right , somehow decrease couple of pixels then.
we have margin-right:+-px, padding-right:+px, not background-position-right:+-px ?
background-position: right 20px;
https://developer.mozilla.org/en-us/docs/css/background-position
jsbin example: http://jsbin.com/ixejey/1/
update:
oops, may have misunderstood question. above positions background image right side , 20px top--but not set distance away right side. don't think can @ time css alone.
for instead of using background image on element directly, wrap element inside wrapper div, add second div hold "background" image , position absolutely--which can right specific distance.
example of alternative option:
<div id="yourcontainer"> <div id="yourbackgroundimage"></div> <div id="yourcontent">your content</div> </div>
css:
#yourcontainer { position: relative; } #yourbackgroundimage { width: 100; height: 100; position: absolute; right: 50px; }
Comments
Post a Comment