Html 将背景图像定位在从底部偏移的元素中
有没有办法将背景设置为固定在中心和底部,但不与元素底部齐平,而是从元素底部向上100像素 (当然,bg图像仅在div边界内可见) 这是我到目前为止得到的,但我不知道如何将图像从底部提升100像素Html 将背景图像定位在从底部偏移的元素中,html,css,background-image,Html,Css,Background Image,有没有办法将背景设置为固定在中心和底部,但不与元素底部齐平,而是从元素底部向上100像素 (当然,bg图像仅在div边界内可见) 这是我到目前为止得到的,但我不知道如何将图像从底部提升100像素 background: url("/path/to/bg.jpg") no-repeat fixed center bottom #FFF; (请不要回答javascript)非常简单: background-color: #fff; background-image: url("/path/to/
background: url("/path/to/bg.jpg") no-repeat fixed center bottom #FFF;
(请不要回答javascript)非常简单:
background-color: #fff;
background-image: url("/path/to/bg.jpg");
background-repeat: no-repeat;
background-position: center bottom 100px; /* answer */
Ref:
更多内容请阅读:非常简单:
background-color: #fff;
background-image: url("/path/to/bg.jpg");
background-repeat: no-repeat;
background-position: center bottom 100px; /* answer */
Ref:
更多内容请阅读:谢谢,这会有用的。还有一件事正好符合我的要求:
background-attachment:fixed代码>:)谢谢,这会有用的。还有一件事正好符合我的要求:background-attachment:fixed代码>:)