2012-08-03 109 views
0

我無法在本地工作: http://jsfiddle.net/efortis/t6QsP/ 我懷疑CSS或類似的陰影,因爲我看起來非常小心,它應該工作,它曾經工作,但由於許多更新我已經失去了窗口列表顏色的良好漸變功能。我的窗口現在看起來像這樣沒有梯度:渲染CSS水平漸變

enter image description here

這是不是我,因爲我定義的HTML CSS類期待:

<div class="popup" id="popupD" 
      style="display: none;" > 

<table width="100%" border="1" cellspacing="0" cellpadding="2" align="center" class="horizontal-gradient"> 
    <tr> 
    <td colspan="3"><h2><div class="horizontal-gradient">Pandora sök</div></h2> 
</td> 
    <td><a href="javascript:void(0)" onclick="document.getElementById('popupD').style.display = 'none';">X</a></td> 
</tr> 
</table> 
     <table id="mainTable" border="0" class="tabell" cellspacing="5" cellpadding="2"> 
      <tr> 
      <!-- Placeholder for the form table --> 
      <td valign="top"> 
       <table id="formTable" border="0" class="tabell" cellspacing="2" cellpadding="2"> 
       <tr> 
        <td> 
        <b>Sök efter handläggare</b> 
        </td> 
       </tr> 
       <tr> 
        <td>&nbsp;</td> 
       </tr> 
       <tr> 
        <td>Sök efter person, funktion, organisation, roll eller signatur med följande namn:</td> 
       </tr> 
       <tr> 
        <td> 
        <input type="text" class="textandlist" name="searchValue" size="40" /> 
        </td> 
       </tr> 
       <tr> 
        <td align="right"> 
        <input type="button" class="knapp" name="searchButton" id="searchButton" value="&nbsp;&nbsp;Sök&nbsp;&nbsp;" onclick="doSubmit('HandlaggareSearch','search')" /> 
        <input type="button" class="knapp" name="cancelButton" id="cancelButton" value="Avbryt" onclick="cancelHandlaggareDialog()" /> 
        <input type="button" class="knapp" name="showButton" id="showButton" value="Visa alla" onclick="doSubmit('HandlaggareSearch','showAll')" /> 
        </td> 
       </tr> 
       </table>      
      </td> 
      <!-- Placeholder for the result table --> 
      <td valign="top"><a href="javascript:void(0)" onclick="document.getElementById('popupD').style.display = 'none';">Stäng</a> 

       <img src="/PandoraArendeWeb/images/spacer.gif" /> 
       <table id="headerTable" class="tabell" cellspacing="2" cellpadding="2" width="700"> 

       <tr> 
        <td colspan="5"> 
        <b>Sökningen gav inga träffar.</b> 
        </td> 
       </tr> 

       <tr> 
        <td colspan="5"> 
        <b>Resultat</b> 
        </td> 
       </tr> 
       <tr> 
        <td colspan="2"> 
        <span>Antal träffar: </span> 
        </td> 

        <td colspan="3" align="right"> 

        <a href="javascript:SearchHandlaggareShow('previous')"> 
        &lt;&lt; 

        - 

        </a> 

        [ 

        - 

        ] 

        <a href="javascript:SearchHandlaggareShow('next')"> 

        - 

        &gt;&gt; 
        </a> 

       </td> 

       </tr> 

      </table> 

      <div style="height: 220px; overflow: auto;" > 
       <table id="resultTable" class="tabell" cellspacing="2" cellpadding="2" width="700"> 
       <tr> 
        <th><a href="javascript:SearchHandlaggareSort('1')">Signatur</a></th> 
        <th><a href="javascript:SearchHandlaggareSort('2')">Namn</a></th> 
        <th><a href="javascript:SearchHandlaggareSort('3')">Enhet</a></th> 
        <th><a href="javascript:SearchHandlaggareSort('4')">Grupp</a></th> 
        <th><a href="javascript:SearchHandlaggareSort('5')">Roll</a></th> 
       </tr> 

       <tr class="bakgrund1" onmouseover="this.className='highlight'" onmouseout="this.className='bakgrund1'"> 

        <td></td> 
        <td></td> 
        <td></td> 
        <td></td> 
        <td></td> 
       </tr> 

       </table> 
      </div> 

      </td> 
     </tr> 
     </table> 
     </div> 

我問過這件事,我們的結論是,這個問題是與我的其他代碼的東西: https://stackoverflow.com/questions/11344739/css-horizontal-gradient-not-working 所以我懷疑我是從某個地方遮蔽CSS類,這是我唯一的解釋。你有什麼想法如何解決這個問題?

這裏是整個CSS文件,我沒有發現陰影:

* {font-family:arial;} 

.avnamn{ 
       color: #90002b; 
       font-size: 140%; 
       display: inline; 
       vertical-align: 3%; 
       margin-left: 1%; 
       } 

.b{border:1px solid #000;} 

.readonly{background-color: #CCC;} 

.Webdings{ 
    font-family: Webdings; 
    } 

ul{margin-top: 0px} 

.mt3{margin-top:-3px;} 
.mt5p{margin-top:5px;} 

.fontS80 {font-size: 80%;} 
a:link{color:#000; text-decoration:none; } 
a:visited{color:#000; text-decoration:none; } 
a:hover{color:#000; text-decoration:none; } 
a:active{color:#000; text-decoration:none; } 

.fontS75 {font-size: 75%;} 

.link{color: #003366; 
    text-decoration: underline; 
    cursor: pointer; 
    font-weight: bold;} 

.link_sm{color: #003366; 
    text-decoration: underline; 
    cursor: pointer;} 

.link_sm{font-size: 70%;cursor: pointer;} 

.small{font-size: 75%;} 

.smallg{font-size: 75%; 
color: #555;} 

.ssmall{ 
    font-size: 65%; 
    font-weight: bold; 
    color: #555; 
} 
.small60{font-size: 60%;} 
.small50{ 
    font-size: 50%; 
    color: #333; 
} 
.smallb{font-size: 85%;} 
table{display:inline;} 

h1{font-size: 130%;display:inline;} 
h2{font-size: 100%;display:inline;} 
h3{ 
    font-size: 80%; 
    display:inline; 
    font-family: "Arial Unicode MS", Arial, Helvetica, sans-serif; 
} 
h4{font-size: 70%;display:inline;} 
h5{ 
    font-size: 80%; 
    display:inline; 
    font-family: "Arial Unicode MS", Arial, Helvetica, sans-serif; 
} 

.hthin{ 
    font-size: 125%; 
} 

.th {text-align: left;} 

td, th{font-size: 75%; 
    vertical-align: text-top;} 
.td_link{cursor: pointer;} 
.td40{height:40px;} 
.td60{height:60px;} 



.thkant{ 
    border-top: 1px solid #000; 
    border-bottom: 1px solid #000; 
    font-size: 70%; 
     text-align: left; 
} 

.labb{F0F0E3; c1c1b3 } 

.bb{border-bottom: 1px solid #000;} 
.bbV{border-bottom: 1px solid #FFF;} 
.TB_nbA {background-color:#CCC;} 
.TB_bt, .TB_nb, .TB_db, .TB_bb {background-color:#efefdc;} 

.hk {background-color:#d9ddb3;} 

.hknot {background-color:#f9faf2;} 
/*<!--F8F8F1-->*/ 
.TB_bt{border-top: 1px solid #FFF;} 
.TB_bt5{border-top: 5px solid #FFF;} 
.TB_bb{border-bottom: 1px solid #999;} 
.TB_bb2{border-bottom: 2px solid #c1c1b3;} 
.TB_db{border-bottom: 1px solid #000; border-top: 1px solid #000;} 
.TB_tb{border-top: 2px solid #efefdc;} 

.TB_bo{border: 2px solid #efefdc;} 
.TB_bo_hk{border-top: 1px solid #efefdc;} 


.TB_bo2{border: 1px solid #efefdc;} 

.TB_bo2B{ 
border-top: 2px solid #c1c1b3; 
border-left: 3px solid #efefdc; 
border-right: 3px solid #efefdc; 
border-bottom: 2px solid #c1c1b3; 
} 

.TD_bo{ 
    border-right: 1px solid #c1c1b3; 
    width: 9%; 
    font-size: 70%; 
    text-align: center; 
} 

.TD_bo2{ 

    border-right: 0; 
    width: 9%; 
    font-size: 70%; 
    text-align: center; 
} 

.ytb{ 
    border-left:3px solid #efefdc; 
    border-right:3px solid #efefdc; 
} 

.datum { 
    font-size: 70%; 
    padding-right: 5px; 
    vertical-align: text-top;} 
.sub {background:#EAEAEA;} 
.sub_meny, .sub_meny_r, .sub_meny_active, .sub_meny_sm{ 
    font-size: 70%; 
    padding-left: 20px; 
    padding-right: 20px; 
    vertical-align: text-top;} 

.sub_meny_sm { 
    font-size: 60%; 
    vertical-align: middle; 
    padding-left: 10px; 
    padding-right: 10px; 
} 

.sub_meny_r{ 
    float:right; 
    font-size: 70%; 
    padding-left: 8px; 
    padding-right: 8px;} 

.sub_meny_rm{margin-top:4px;} 
.sub_meny_active{font-weight: bold;} 

.flikkant1 { 
    background-image: url(../images/fl1k.jpg); 
    background-position: center; 
    z-index: -1;} 

.inl_namn{ 
    font-weight: bold; 
    font-size: 70%; 
    color: Black; 
    text-decoration: none;} 

.th{text-align: left;} 
.tr{text-align: right;} 

.g1{ 
    background-color: #FFF; 
    line-height: 20px; 
} 

.g2{ 
    background-color: #EEE; 
    line-height: 20px; 
} 

.g3{ 
    background-color: #DCDCDC; 
    line-height: 20px; 
    font-weight: bold; 
    font-size: 100%; 
} 
.g4{ 
    background-color: #CCC; 
    line-height: 20px; 
} 

.popup{ 
    border-color: #000; 
    border-style: groove; 
    border-width: 2px; 
    padding: 0px; 
    background-color: #FFF; 
    font-size: 70%; 
} 

.popuphandlaggare{ 
    border-color: #000; 
    border-style: groove;  
    border-width: 2px;  
    padding: 0px;  
    background-color: #FFF;  
    font-size: 70%;  
    position: absolute;  
    top: 900px; 
    } 

.popupN{ 
    background-color: #F0F0E3; 
    color: #000; 
    width: 100%; 
    display: inline; 
    font-weight: bold; 
    height: auto; 
    padding: 2px; 
    border-bottom: 1px solid #000; 
} 
.pin{padding: 6px;} 

.fl10, .fl20, .fl30, .fl40, .fl50, .fl60, .fl70, .fl80, .fl90, .fl100 { 
    padding-bottom:4px;color: #000000; 
} 

.over{ 
    background-color: #EFEFDC; 
    line-height: 20px; 
} 

.half{ 
line-height:50%; 
} 

.quarter{ 
line-height:25%; 
} 

.lh10{ 
line-height:10%; 
} 

.checkmargin {margin-right: 25px;} 
.checkmarginL {margin-left: 25px;} 

.pusher {padding-left: 15px;"} 
.pusherR {margin-right: 40px;"} 

.rand3{background-color: #FFF; line-height: 3px;} 
.rand1{background-color: #FFF; line-height: 1px;} 

.whiteborder {  color: #ffffff;  border: 4px solid #ffffff;  padding: 10px;  margin: 10px; } 
#details { width: 700; color: #ffffff; } 
.column1 {  color: #000000; margin: 0;  padding: 0;  width: 600px;  border:0;  float: left; } 
.column2 {  color: #000000;margin: 0;  padding: 0;  border:0;  width: 80px;  float: right; } 

.f200 { 
    color: #000000; 
} 

.f210 { 
    color: #000000;float: left; 
} 
.f220 { 
    width: 400; 
} 
.f1450 { 
    width: 600; 
    float:left; 
} 
.f1550 { 
    width: 150; 
    float:left; 
    padding:15px; 
} 
.paddedcell { 
    padding:15px; 
} 
.b2{border:2px solid #efefdc;} 
.inp_sel{width: 80%;} 

.fl21{float:left; padding:5px; margin:5px; width:150px;} .fl455{float:left; padding:5px; margin:5px; width:120px;} 

.form-bg { 
    background: #eeefdf; 
    width:1000px; 
    overflow:hidden; 
} 
.form-bg2 { 
    background: #eeefdf; 
    width:100%; 
    overflow:hidden; 
} 
.data-bar { 
    border-bottom:1px solid #fbfbf7; 
    display:inline-block; 
    padding:10px 10px; 
} 

.left { 
float:left; 
width:200px; 

} 
.discount { 
float:right; 
width:500px; 

} 
.discounts { 
width:900px; 

} 
.right { 
float:right; 
width:700px; 
} 
.yta20 { 
background: #eeefdf; 
width:1100px; 
} 

.yta2 { 

width:1100px; 
} 

.data-box { 
width:650px; 
height:100px; 
border:1px solid #cbcbcb; 
} 
#table td { 
margin:120px; 
} 

#personName {  float:left;  width:300px; } #otherDetails {  float:right;  width:450px;  } 

.th_rad_sort {border-bottom: 2px solid #000000; text-decoration: none;"} 

a img { border: 0; outline:0;} 

.horizontal-gradient { 
    background: #1a2adb; /* Old browsers */ 
    background: -moz-linear-gradient(left, #1a2adb 0%, #a1e6ed 100%); /* FF3.6+ */ 
    background: -webkit-gradient(linear, left top, right top, color-stop(0%,#1a2adb), color-stop(100%,#a1e6ed)); /* Chrome,Safari4+ */ 
    background: -webkit-linear-gradient(left, #1a2adb 0%,#a1e6ed 100%); /* Chrome10+,Safari5.1+ */ 
    background: -o-linear-gradient(left, #1a2adb 0%,#a1e6ed 100%); /* Opera 11.10+ */ 
    background: -ms-linear-gradient(left, #1a2adb 0%,#a1e6ed 100%); /* IE10+ */ 
    background: linear-gradient(left, #1a2adb 0%,#a1e6ed 100%); /* W3C */ 
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#1a2adb', endColorstr='#a1e6ed',GradientType=1); /* IE6-9 */ 
    color: white; 
    width: 1015px; 
} 
.f { float: right;  color: white; } 


.handlaggare { width: 1000px; } 

div.data-box-nat{ 
    margin-bottom: 10px; 
    border: 2px solid gray; 
    width: 600px; 
} 
div.data-box-pct{ 
    margin-bottom: 10px; 
    border: 2px solid gray; 
    width: 600px; 
} 
.newpopup { 
z-index:100; 
position: absolute; 
    top:50%; 
    left:50%; 
    background-color:#ffffff; //not working 

} 

鉻檢查元素表明,CSS被劃掉。這是什麼意思? enter image description here

+1

當我在chrome中查看它時,它工作正常:http://jsfiddle.net/t6QsP/1/您使用哪種瀏覽器? – ilivewithian 2012-08-03 09:19:25

+0

@ilivewithian我也可以看到小提琴,但它是我的本地版本,不工作。我從小提琴中獲取代碼,但在本地不適合我。 – 2012-08-03 09:52:40

回答

1

既然你提供的代碼工作正常,我能不能重現您的問題,這裏是你如何調試它:

  1. 打開不正常的網頁在Chrome
  2. 保持按Ctrl + Shift並按i - 開發人員工具將出現
  3. 轉到「元素」選項卡
  4. 按下窗口底部按鈕之間的放大鏡,然後單擊頁面上有問題的元素。在你的情況下,選擇應該有一個漸變的元素。
    :使用「元素」選項卡中的DOM瀏覽器瀏覽您訪問元素的方式。
  5. 選中元素後,檢查右欄中的「樣式」選項卡。所有樣式已應用到您的元素,按從上到下優先排序,這意味着如果已爲相同屬性定義了兩種樣式,則上面的樣式優先。

現在您可以看到您的樣式是否已被覆蓋到任何位置,以及樣式表和其中哪一行發生了。

+0

非常有趣!這些款式已交叉,我更新了原始問題,請看看。這是什麼意思?這些樣式被覆蓋? – 2012-08-03 11:12:15

+1

深入挖掘。查看「計算樣式」部分,查看CSS屬性的結果。再往下看,看看有沒有'inherit'或'!設置在「背景」或「背景圖片」屬性上的「重要」值 – Hubro 2012-08-03 11:36:16

+0

我按照說明操作,我可以使其在Chrome中工作,但不能在Internet Explorer中使用。 「計算風格」看起來像div被其他屬性所掩蓋,但我找不到任何其他定義它的CSS。當它在Chrome中運行時,奇怪的是它不能在另一個瀏覽器中運行,而我在Chrome中的工作原理是將類描述符更改爲一個id描述符,然後它在chrome中運行。我也可以嘗試和更改名稱,並會更新問題,因爲我發現更多信息。請稍等一下,看看我能否真正解決它 – 2012-08-06 11:54:39