【发布时间】:2015-11-10 14:43:18
【问题描述】:
我有一个位于http://bit.ly/1gH5Nqw 的站点,该站点在页面中间的内容块后面有一个白色背景。在除 Safari 之外的所有浏览器中,白色背景都延伸到视口的左右边缘。有谁知道为什么或如何纠正这个问题?
这是我的 CSS:
div#maincontentcontainer div#home-services-block,
div#maincontentcontainer div#inner-page-content {
background-color: #fff; /* trying to get background to appear in Safari browser */
margin-top: 60px;
position: relative; /* to get the container to extend to the screen/viewport margins */
}
div#maincontentcontainer div#home-services-block:after,
div#maincontentcontainer div#inner-page-content:after { /* to get the container to extend to the screen/viewport margins (http://stackoverflow.com/questions/28565976/css-how-to-overflow-from-div-to-full-width-of-screen) */
content: "";
position: absolute;
height: 100%;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 100vw;
background-color: #fff; /* changed `background:` to `background-color:` to see if white background would appear in Safari browser -- it did not */
z-index: -1;
}
【问题讨论】:
-
你能发布截图显示 Safari 和任何其他浏览器之间的区别吗?
-
感谢@oxguy3 的帮助
-
what vsn of safari?Safari 5.1.7 (7534.57.2) -
我不确定如何在我的 PC 上测试它在 Mac 上的真实外观。有一些网站会复制浏览器和移动设备以进行测试,但我找不到显示 Mac Safari 浏览器外观的网站。
-
Safari 5...真的很老了,我不确定它是否支持无前缀
transform
标签: html css safari background-color