2013-03-19 61 views
1

我申请的CSS gradiant效果,这样表的“日”一栏,显示与CSS Gradiant效果的图像

background: -moz-linear-gradient(top,white 5%,#D6DFE3); 
    background: linear-gradient(top,white 5%,#D6DFE3); 

后,我不得不追加一个类,其CSS是像这样的一些事情在这我想显示的图像

.Img 
{ 
    background-image:url(../images/asc.png); 
    background-color:Green; 
} 

我追加.IMG类。但由于渐变效果,图像未显示。我怎样才能解决这个问题。

回答

0

试试这个:

th{ 
    background: -moz-linear-gradient(top,white 5%,#D6DFE3); 
    background: linear-gradient(top,white 5%,#D6DFE3); 
    z-index:-1; 
} 
.Img 
{ 
    background-image:url(../images/asc.png); 
    background-color:Green; 
    z-index:1;position:absolute; 
} 
+0

不是为我工作 – user1884709 2013-03-19 05:02:33

+0

可以在'th'使用'图像tag'。 – 2013-03-19 05:24:42

1

您可以在使用<img>标签<th>或任何其他标记像<span><button>,并给它所需的背景风格

1

我解决了这个问题,因为

th{ 
    background: -moz-linear-gradient(top,white 5%,#D6DFE3); 
    background: linear-gradient(top,white 5%,#D6DFE3); 
} 

.Img 
{ 
    background :url(../images/asc.png), -moz-linear-gradient(top,gray 5%,#D6DFE3) !important; 
    background: url(../images/asc.png), linear-gradient(top,gray 5%,#D6DFE3) !important; 

    background-position:right center !important; 
    background-repeat:no-repeat !important; 
} 

The !important important tag did欺骗我。我能够用覆盖的行为!重要