跨浏览器渐变问题

时间:2011-06-28 19:56:22

标签: css3 cross-browser gradient

#PEOPLE {
    text-shadow:#f2f2f2 0px 1px  0px;
    color:#333;
    margin-left: 20px;
    background-color: #F0F0F0;
    border-radius: 1em 1em 1em 1em;
    -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
    -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
    font-family: "helvetica neue", helvetica, arial, sans-serif;

    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#f8f8f8', endColorstr='#f1f1f1'); /* for IE */
    background: -webkit-gradient(linear, left top, left bottom, from(#f7f7f7), to(#f1f1f1)); /* for webkit browsers */
    background: -moz-linear-gradient(top,  #f8f8f8,  #f1f1f1); /* for firefox 3.6+ */
    margin-top: 25px;
    margin-right: 10px;
    text-align: left;
    height: 235px;
}

在chrome& amp; firefox但不是ie8。我没有尝试其他浏览器。 我需要你的帮助

1 个答案:

答案 0 :(得分:2)

你可以尝试:

  background-color: #f8f8f8;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f1f1f1)); /* Saf4+, Chrome */
  background-image: -webkit-linear-gradient(top, #f8f8f8, #f1f1f1); /* Chrome 10+, Saf5.1+ */
  background-image:    -moz-linear-gradient(top, #f8f8f8, #f1f1f1); /* FF3.6 */
  background-image:     -ms-linear-gradient(top, #f8f8f8, #f1f1f1); /* IE10 */
  background-image:      -o-linear-gradient(top, #f8f8f8, #f1f1f1); /* Opera 11.10+ */
  background-image:         linear-gradient(top, #f8f8f8, #f1f1f1);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f8f8f8', EndColorStr='#f1f1f1'); /* IE6–IE9 */

(从http://css3please.com/生成 - 因此保证语法等正确!)

看看这里:http://jsfiddle.net/VGhyB/看它是否有效。