Gridview样式的CSS控制

页面代码:

01.<asp:GridView ID="gvCustomres" runat="server"  
02.    DataSourceID="customresDataSource"    
03.    AutoGenerateColumns="False"  
04.    GridLines="None"  
05.    AllowPaging="true"  
06.    CssClass="mGrid"  
07.    PagerStyle-CssClass="pgr"  
08.    AlternatingRowStyle-CssClass="alt">  
09.    <Columns>  
10.        <asp:BoundField DataField="CompanyName" HeaderText="Company Name" />  
11.        <asp:BoundField DataField="ContactName" HeaderText="Contact Name" />  
12.        <asp:BoundField DataField="ContactTitle" HeaderText="Contact Title" />  
13.        <asp:BoundField DataField="Address" HeaderText="Address" />  
14.        <asp:BoundField DataField="City" HeaderText="City" />  
15.        <asp:BoundField DataField="Country" HeaderText="Country" />  
16.    </Columns>  
17.</asp:GridView>  
18.<asp:XmlDataSource ID="customresDataSource" runat="server" DataFile="~/App_Data/data.xml"></asp:XmlDataSource> 

css代码

01..mGrid {    
02.    width: 100%;    
03.    background-color: #fff;    
04.    margin: 5px 0 10px 0;    
05.    border: solid 1px #525252;    
06.    border-collapse:collapse;    
07.}   
08..mGrid td {    
09.    padding: 2px;    
10.    border: solid 1px #c1c1c1;    
11.    color: #717171;    
12.}   
13..mGrid th {    
14.    padding: 4px 2px;    
15.    color: #fff;    
16.    background: #424242 url(grd_head.png) repeat-x top;    
17.    border-left: solid 1px #525252;    
18.    font-size: 0.9em;    
19.}   
20..mGrid .alt { background: #fcfcfc url(grd_alt.png) repeat-x top; }   
21..mGrid .pgr { background: #424242 url(grd_pgr.png) repeat-x top; }   
22..mGrid .pgr table { margin: 5px 0; }   
23..mGrid .pgr td {    
24.    border-width: 0;    
25.    padding: 0 6px;    
26.    border-left: solid 1px #666;    
27.    font-weight: bold;    
28.    color: #fff;    
29.    line-height: 12px;    
30. }      
31..mGrid .pgr a { color: #666; text-decoration: none; }   
32..mGrid .pgr a:hover { color: #000; text-decoration: none; }  

 

转载于:https://www.cnblogs.com/yangwujun/p/5311141.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值