背景位置的 CSS 奇怪行为

标签 css background-position

我有这个 CSS 在 div 中显示水印:

background-image: url("../Images/Watermark02.png") !important;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: right bottom;

行为如下图所示,有人可以帮助我并告诉我让它像 FF 一样在 Chrome 上运行缺少什么吗?

enter image description here

最佳答案

您可以通过删除 background-attachment: fixed 来解决这个问题。 “固定”值是相对于屏幕的,而不是你在里面有背景图像。当然,这可能是由于其他原因造成的,但我需要查看您的其余 CSS/HTML。

background-attachment: fixed; /* Remove this */

我在这里为您设置了一个 jsfiddle:http://jsfiddle.net/HkBh4/

关于背景位置的 CSS 奇怪行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21977946/

相关文章:

html - 表格数据在html底部有很多空间

css - 将列数用于响应式网格系统

javascript - 任何使 CSS3/HTML5 网站在所有浏览器(包括 IE6-8)上运行的 JavaScript 库?

css - 关于background和calc()的一个小问题

html - 为什么背景位置不起作用?

javascript - 遍历 Sprite 并保存背景位置

javascript - 在div中自动从右向左滚动文本

javascript - AnimationEnd 隐藏另一个 div

css - 当背景大小为 100% 时,如何使用百分比为背景位置设置动画?