Search code examples
htmlcssfirefoxmozilla

Css Paper effect not working in FireFox


I created a div that gets dynamically populated with javascript that has a background that resembles a piece of notebook paper. This works in safari and chrome but for some reason doesnt render correctly in firefox. Can anyone give me some insight on whats wrong with my styling ?

This image is of chrome and safari.

Working Effect (chrome ie safari etc..

This image is of Firefox. Broken paper effect

Here is my html and 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);
}

+Bonus for ie compatibility


Solution

  • You are missing the unprefixed version in background-size:

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

    fiddle

    and for the bonus, added -ms-linear-gradient (and changed unprefixed data)

    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