html - Css Paper 效果在 FireFox 中不起作用

标签 html css firefox mozilla

我创建了一个动态填充 javascript 的 div,其背景类似于一张笔记本纸。这在 safari 和 chrome 中有效,但由于某种原因在 firefox 中无法正确呈现。谁能告诉我一些关于我的造型有什么问题的见解?

这张图片是 chrome 和 safari 的。

Working Effect (chrome ie safari etc..

此图片来自 Firefox。 Broken paper effect

这是我的html和css

<div id="paperBackground" class="col-sm-6 paper">
   <h3 style="text-decoration:underline;"><i>Shopping List<i></h3>
   <div class="multiOrderList">
     <p id="list"></p>
   </div>
   <div style="clear: both;"></div>
 </div>

.paper{
  width: 100%;
  min-height: 175px;
  height: 100%;
  border: 1px solid #B5B5B5;
  background: white;
  background: -webkit-linear-gradient(top, #848EEC 0%, white 8%) 0 57px;
  background: -moz-linear-gradient(top, #848EEC 0%, white 8%) 0 57px;
  background: linear-gradient(top, #848EEC 0%, white 8%) 0 57px;
  -webkit-background-size: 100% 30px;
  -moz-background-size: 100% 30px;
  -ms-background-size: 100% 30px;
  -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
  -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
   box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
}

+ie 兼容性的好处

最佳答案

您缺少背景大小中的无前缀版本:

-webkit-background-size: 100% 30px;
-moz-background-size: 100% 30px;
-ms-background-size: 100% 30px;
background-size: 100% 30px;     // !!!

fiddle

为了奖励,添加了 -ms-linear-gradient(并更改了无前缀数据)

background: -webkit-linear-gradient(top, #848EEC 0%, white 8%) 0 57px;
background: -moz-linear-gradient(top, #848EEC 0%, white 8%) 0 57px;
background: -ms-linear-gradient(top, #848EEC 0%, white 8%) 0 57px;
background: linear-gradient(to top, #848EEC 0%, white 8%) 0 57px;

fiddle2

关于html - Css Paper 效果在 FireFox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22305384/

相关文章:

html - 如何仅使用 CSS 从 iFrame 中将图标粘贴到屏幕底部?

html - 从 Perl 中的 HTMl/XML 标签中提取文本

css - asp.net 图像(不在图像文件夹中)被嵌入样式隐藏

html - 创建社交媒体工具提示

javascript - Bootstrap 3 和 Angular JS - 带有表格和 div 的行

Java HttpURLConnection 在工作中被阻止,但 Firefox 不会被阻止

html - 当子标签的宽度为 : 100%? 时,如何调整我的 CSS 以便 Firefox 尊重填充

css - 如果我使用 HTML5 文档类型,为什么不能使我的 div 100% 高度?我如何获得它的 100% 高度

html - 调整屏幕大小时,Chrome 上的表格无法恢复

javascript - Firebug 在骗我吗?