css - How do I position my background image in the center of my div, but give it an offset? -


i have background image div want in center, offset slightly. if background-position: x y; doesn't keep centered page widens.

you can use percents proportionally specify background-position so:

element {     background-image: url(' ... ');     background-repeat: no-repeat;     background-position: 55% 50%; } 

see jsfiddle


Comments