2014-10-10 171 views
1

你好我試圖做一個皮膚GridView控件包含一個CSS文件尋呼機風格在asp.net

每一件事情做工精細,但懸停在尋呼機號碼的風格並沒有改變字體的顏色 我不知道爲什麼

皮膚代碼:

<asp:GridView runat="server" Width="95%" AutoGenerateColumns="False" SkinId="GridBlue" 
    CellPadding="4" ForeColor="#333333" HorizontalAlign="Center" Font-Size="10" Font-Names="Arial" BorderWidth="2px" AllowPaging="true" PageSize="5" 
    AllowSorting="true"> 
     <HeaderStyle Font-Bold="True" ForeColor="#faf6e0" Height="30px" CssClass="gv_hd" /> 
     <FooterStyle Font-Bold="True" ForeColor="#faf6e0" Height="30px" CssClass="gv_ft" /> 
     <RowStyle BackColor="#faf6e0" CssClass="gv_row" Height="30px" /> 
     <AlternatingRowStyle BackColor="#ede0b9" CssClass="gv_row" Height="30px"/> 

     <PagerSettings Mode="Numeric" /> 
     <PagerStyle Height="35px" CssClass="gv_pgr" VerticalAlign="Middle" HorizontalAlign="Center" /> 

     <EditRowStyle BackColor="#dfc987" VerticalAlign="Middle" HorizontalAlign="Center" CssClass="gv_slct" ForeColor="#5f5f5f" /> 
     <SelectedRowStyle BackColor="#dfc987" VerticalAlign="Middle" HorizontalAlign="Center" font-bold="true" CssClass="gv_slct" ForeColor="#5f5f5f" /> 

     <EmptyDataTemplate> 
      <center><h1 class="gv_mpty">No Records Found</h1></center> 
     </EmptyDataTemplate> 


    </asp:GridView> 

CSS代碼:

.gv{text-align:center;} 
.gv_hd{height:22px;text-decoration:none;border:#5f5f5f solid 2px;background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #548975), color-stop(1, #37705a));background:-moz-linear-gradient(top, #548975 5%, #37705a 100%);background:-webkit-linear-gradient(top, #548975 5%, #37705a 100%);background:-o-linear-gradient(top, #548975 5%, #37705a 100%);background:-ms-linear-gradient(top, #548975 5%, #37705a 100%);background:linear-gradient(to bottom, #548975 5%, #37705a 100%);} 
.gv_hd a{text-decoration:none;} 
.gv_hd a:hover{text-decoration:underline;} 
.gv_hd a:active{text-decoration:underline;} 
.gv_ft{padding:10px;text-decoration:none;border:#5f5f5f solid 2px;background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #548975), color-stop(1, #37705a));background:-moz-linear-gradient(top, #548975 5%, #37705a 100%);background:-webkit-linear-gradient(top, #548975 5%, #37705a 100%);background:-o-linear-gradient(top, #548975 5%, #37705a 100%);background:-ms-linear-gradient(top, #548975 5%, #37705a 100%);background:linear-gradient(to bottom, #548975 5%, #37705a 100%);} 
.gv_row{text-align:center;color:#5f5f5f;padding:} 
.gv_row a{text-decoration:none;} 
.gv_row a:hover{text-decoration:underline;} 
.gv_pgr{color:#5f5f5f;padding:20px;background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #faf6e0), color-stop(1, #e7d6a1));background:-moz-linear-gradient(top, #faf6e0 5%, #e7d6a1 100%);background:-webkit-linear-gradient(top, #faf6e0 5%, #e7d6a1 100%);background:-o-linear-gradient(top, #faf6e0 5%, #e7d6a1 100%);background:-ms-linear-gradient(top, #faf6e0 5%, #e7d6a1 100%);background:linear-gradient(to bottom, #faf6e0 5%, #e7d6a1 100%);} 
.gv_pgr a{font-weight:bold;margin-top:10px;background-color:transparent;padding:4px 10px;text-decoration:none;border:1px solid #d9c074;} 
.gv_pgr a:hover{font-weight:bold;background-color:#548975;border:1px solid #d9c074;color:White;} 
.gv_pgr a:active{font-weight:bold;background-color:#548975;color:#faf6e0;border:1px solid #d9c074;} 
.gv_pgr span{background-color:#548975;color:#faf6e0;border:1px solid #d9c074;padding:4px 10px;} 
.gv_mpty{color:#5f5f5f;} 
.gv_slct a{text-decoration:none;text-align:center;} 
.gv_slct a:hover{text-decoration:underline;text-align:center;} 

懸停在傳呼機的字體沒有改變

+0

這不是典型的ASP重要,請重新標記。 – Paul 2014-10-13 07:38:18

回答

0

當網格呈現時,可以使用F12來檢查CSS,html。確保將該行作爲要使突出顯示工作的類。

+0

我知道css是什麼...但爲什麼它不起作用 – 2014-10-10 16:43:28

+0

一切似乎都沒問題,這就是爲什麼我要求你檢查html。你確定該傳呼機包含鏈接?可能選擇者是問題。確保瀏覽器中沒有任何內容在緩存中,點擊ctrl + r清除緩存並重新加載css。 – 2014-10-10 17:46:39

+0

好的我找到了解決方案: 懸停css:color:#.....!important; 其解決問題 – 2014-10-10 21:43:51

0
.gv_pgr a:hover{font-weight:bold;background-color:#548975;border:1px solid #d9c074;color:White !Improtant;} 

加入!色標