编码弯曲阴影框以实现跨浏览器兼容性的最佳方法
我有这样设计的盒子
基本上我需要对它们进行编码,以便它们可以根据内部内容,高度和宽度可以是任何尺寸。另外,阴影效果需要是透明的,因为背景颜色可以改变。
最好的方法是让它在所有浏览器中都有效? (IE6+、FF、Opera、Safari、Chrome)
I have boxes that have been designed like this
Basically I need to code them so that they can be any size height-wise and width-wise depending on the content inside. Plus the shadow effect needs to be transparent because the background color can change.
Best way to do this so it works in all browsers? (IE6+, FF, Opera, Safari, Chrome)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您没有 IE6 的要求,您可以使用 very clean &轻量级 jQuery Corners: http://jquery.malsup.com/corner/
实现此目的要在 IE6 中实现效果,您需要使用表格格子的神秘方法,每个角上都有微小的单元格,并使用半透明的角图像。
If you didn't have the requirement for IE6 you could use the very clean & light-weight jQuery Corners: http://jquery.malsup.com/corner/
To achieve this effect in IE6 you'll need to use the arcane method of a table lattice with tiny cells in each corner using semi-transparent corner images.
最好的方法是为现代浏览器设计网站,并允许框阴影和边框半径等内容在较旧的浏览器和 IE 中优雅地降级。
如果你必须在 IE 中使用圆角,我会使用这种方法,我发现它简单且轻量级...
http://www.htmlremix.com/css/curved-corner-border-radius-cross-browser
我无法帮助处理 IE 中的框阴影,我害怕。
The best way is to design your website for modern browsers and allow things such as box shadow and border radius to degrade gracefully for older browsers and IE.
If you must have rounded corners in IE I'd use this method which I've found easy and lightweight...
http://www.htmlremix.com/css/curved-corner-border-radius-cross-browser
I can't help with box shadows in IE, I'm afraid.
实际上,IE 有一个专有的 CSS 扩展,允许您添加阴影:
对于圆角,您必须使用图像或 JavaScript。我尝试过 DD_Roundies,对它非常满意(不过它有一些错误)
对于其他浏览器,可以使用这个:
Actually, IE has a proprietary CSS extension that allows you to add shadows:
For rounded corners, you'll have to use images or JavaScript. I tried DD_Roundies and I'm quite satisfied with it (it has a few bugs though)
As for other browsers, you can use this:
我强烈推荐 CSS3Pie (适用于 IE6-9)。
I would strongly recommend CSS3Pie (works in IE6-9).