Opera css:盒子阴影错误

发布于 2024-11-30 02:40:53 字数 479 浏览 2 评论 0原文

我一直忙于创建我的网站,但是在测试 Opera 上正在进行的主页的过程中,我注意到它添加了一个水平滚动条。从我的页面中删除一些内容后,我注意到如果我只留下一个具有 ID 功能的 div,问题仍然会发生。我尝试搜索它,但在任何地方都找不到任何内容。 以下是示例该问题的页面链接Opera Box Shadow Bug
值得注意的是,它只出现在 Opera 中,并且作为 CSS3 规范的一部分,它指出 box-shadow 不在高度或宽度上。
有人有一个简单的解决方案吗?我发现唯一有效的方法是在盒子阴影 div 周围放置一个包含 Div,或者在几个 div 周围放置一个包含 Div 并设置 Overflow:hidden; ,这与理想状态相去甚远。
我还没有检查过 Opera for Windows,但它发生在 Opera for Mac (v11.50) 上。

I have been busy creating my website, however in the process of testing my in-progress main page on Opera I noticed that It was adding a horizontal scroll bar. After cutting bits out of my page I noticed that if I only left a single div with the ID feature the problem would still occur. I tried searching it by couldn't find anything on it... anywhere.
Here is a link to a page exampling the problem Opera Box Shadow Bug
It is important to note that it only occurs in Opera and as part of the CSS3 Spec it is stated that box-shadow does not at height or width.
Does anybody have a easy solution for this? The only thing that I found that worked was to put a containing Div around the box shadow div, or around several divs and set overflow:hidden; , which is far from ideal.
I haven't checked Opera for Windows but it is occurring on Opera for Mac (v11.50).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我恋#小黄人 2024-12-07 02:40:53

我在 Windows Opera 中测试了您的文件,它的显示方式相同。
我能够使其工作的唯一方法是在 #feature div 周围包裹一个 div,添加溢出:隐藏和更大的高度。这是我的代码

html, body {
margin: 0;
padding: 0;
}
#hidden{
height:400px;
overflow:hidden;
}
#feature {
width:100%;
height: 375px;
background: #000;
box-shadow: 0 4px 4px 4px #000;
}


<div id="hidden">
   <div id="feature">
   </div>
</div>

除此之外,我将使用重复的 1px 宽图像。

I tested your file in Windows Opera and it is displaying the same way.
The only way I was able to make it work was to also wrap a div around your #feature div, add overflow:hidden, and a larger height. Here is my code

html, body {
margin: 0;
padding: 0;
}
#hidden{
height:400px;
overflow:hidden;
}
#feature {
width:100%;
height: 375px;
background: #000;
box-shadow: 0 4px 4px 4px #000;
}


<div id="hidden">
   <div id="feature">
   </div>
</div>

Besides this, I would use a 1px wide image with repeat.

ゞ记忆︶ㄣ 2024-12-07 02:40:53

该错误似乎至少在 Opera 11.60 中得到了解决。

The bug seems to be solved at least in Opera 11.60.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文