经过一点点的修修补补,我想通了!
img.someclass {
background: url("NEW IMAGE URL") top right;
height: 0;
width: 0;
padding: 200px 550px 0 0; /* Insert actual image size (height width 0 0) */
}
Run Code Online (Sandbox Code Playgroud)
这将使实际图像的高度和宽度为0,但会扩展框以使用填充填充图像的大小.唯一的缺点是它在旧版本的Internet Explorer中看起来并不完美.