CSS中从透明到颜色的渐变

kha*_*anh 3 html css

我的老板给了我一张图片(请看下面)并告诉他我会让他的网站看起来一样.这是我的代码,但它看起来不像图像:

HTML

<div class="clearfix" id="footer">
  <ul>
    <li><a href="/pages/facility">Become a Virtual Active Facility</a></li>
    <li><a href="/pages/about">About Us</a></li>
    <li class="last"><a href="/pages/contact">Contact</a></li>
  </ul>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS

#footer {
    background: -moz-linear-gradient(left center, white, white) repeat scroll 0 0 transparent;
    margin-bottom: 25px;
    margin-top: 25px;
    opacity: 0.6;
    padding: 10px 25px;
    width: 914px;
}
Run Code Online (Sandbox Code Playgroud)

替代文字

如何才能使结果看起来一样?

Pet*_*ter 11

您的渐变定义为从"白色"变为"白色".换句话说,没有梯度.

在2014年的最终语法中:

background-image: linear-gradient(to right, transparent, white);
Run Code Online (Sandbox Code Playgroud)

请注意,前缀版本(moz-,webkit-,o-等)使用不同的语法,以实现向后兼容性.