1

おそらく非常によくある質問があります。全体を検索し、ほとんどすべてを試しましたが、display:block、zoom:1、set height、width 何も機能しませんでした。私は実際にはPOP UPであるテーブルを持っており、壁としてjavascriptとjqueryで作られています。これが私のコードの簡単な例です。

$(tr1).css('width','210px');
$(tr1).css('height','63px');
$(tr1).addClass('testClass');
$(tr1).css('border-bottom','solid 1px #c6c7c5');
$(tr1).mouseover(function(){
    $(tr1).css('cursor','pointer');
});

$(tr1).click(function(){
    open_report('EXCEL',sparam);
    popUpIsOpen = false;
    removePopupBtn();
    $(wrapperBox).remove();
});

$(tr2).css('width','210px');
$(tr2).css('height','63px');
$(tr2).addClass('testClass');

そして、これは私のcssです

.testClass{
width: 210px;
height: 63px;
zoom: 1;
display: block;
background-repeat: no-repeat;

background: -webkit-gradient(linear, left top, left bottom, from(#dcdedb), to(#c9cbc8));
background: -moz-linear-gradient(top,  #dcdedb,  #c9cbc8);
background-image: -o-linear-gradient(top,  #dcdedb,  #c9cbc8);
background: -ms-linear-gradient(top, #dcdedb 0%,#c9cbc8 100%);
background: linear-gradient(top, #dcdedb 0%,#c9cbc8 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdedb', endColorstr='#c9cbc8',GradientType=0);
}

.testClass:hover {

background: -webkit-gradient(linear, left top, left bottom, from(#eaebea), to(#d6d7d5));
background: -moz-linear-gradient(top,  #eaebea,  #d6d7d5);
background-image: -o-linear-gradient(top,  #eaebea,  #d6d7d5);
background: -ms-linear-gradient(top, #eaebea 0%,#d6d7d5 100%);
background: linear-gradient(top, #eaebea 0%,#d6d7d5 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eaebea', endColorstr='#d6d7d5',GradientType=0);
}

IE(すべてのバージョン) を除くすべてのブラウザで動作します...どんな助けも大歓迎です! :)


フィルターに GradientType=0 を追加しましたが、まだ機能していません。

4

2 に答える 2

1

CSSをこれに変更すると、動作するはずです

働くフィドル

.testClass {
    width: 210px;
    height: 63px;
    zoom: 1;
    display: block;
    background-repeat: no-repeat;
    background: #dcdedb;
    /* Old browsers */
    background: -moz-linear-gradient(top, #dcdedb 0%, #c9cbc8 100%);
    /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #dcdedb), color-stop(100%, #c9cbc8));
    /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, #dcdedb, #c9cbc8 100%);
    /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, #dcdedb 0%, #c9cbc8 100%);
    /* Opera 11.10+ */
    background: -ms-linear-gradient(top, #dcdedb 0%, #c9cbc8 100%);
    /* IE10+ */
    background: linear-gradient(to bottom, #dcdedb 0%#c9cbc8 100%);
    /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdedb', endColorstr='#c9cbc8', GradientType=0);
    /* IE6-9 */
}
.testClass:hover {
    background: #eaebea;
    /* Old browsers */
    background: -moz-linear-gradient(top, #eaebea 0%, #d6d7d5 100%);
    /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eaebea), color-stop(100%, #d6d7d5));
    /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, #eaebea 0%, #d6d7d5 100%);
    /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, #eaebea 0%, #d6d7d5 100%);
    /* Opera 11.10+ */
    background: -ms-linear-gradient(top, #eaebea 0%, #d6d7d5 100%);
    /* IE10+ */
    background: linear-gradient(to bottom, #eaebea 0%, #d6d7d5 100%);
    /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eaebea', endColorstr='#d6d7d5', GradientType=0);
    /* IE6-9 */
}

IE7 で動作するコードのスクリーンショット IE7 で動作するコードのスクリーンショット

于 2013-07-26T13:17:15.887 に答える