使用主题来自动包装控件样式

管理网站可以直接使用这种主题,很方便。

建立一个主题文件夹,css代码如下:

body
{
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    font-weight
:  normal ;
    color
:  #000000 ;
}

.TableBG
{     
    background-color
:  #cccccc ;
}

.ItemStyle 
{
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    font-weight
:  normal ;
    color
:  #000000 ;
    background-color
:  #FFFFFF ;
    line-height
:  20px ;     
}

.AlternateItemStyle 
{
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    line-height
:  15pt ;
    font-weight
:  normal ;
    color
:  #000000 ;
    background-color
:  #F1F7FC ;
    
}

.HeaderStyle 
{
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    line-height
:  15pt ;
    font-weight
:  bold ;
    color
:  #FFFFFF ;
    background-image
:  url(images/tile_back.gif) ;     
    text-align
: center ;
}

.FooterStyle 
{
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    line-height
:  15pt ;
    font-weight
:  normal ;
    color
:  #000000 ;
    background-image
:  url(images/tile_sub.gif) ;
    text-align
: center ;
}


{
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    font-weight
:  normal ;
    color
:  #000000 ;
    text-decoration
:  none ;
    cursor
:  hand ;
}

a:hover 
{
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    font-weight
:  normal ;
    color
:  #4083D5 ;
    text-decoration
:  none ;
    cursor
:  hand ;
    background-color
:  #FFFFFF ;
}

a.a2
 
{
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    font-weight
:  bold ;
    color
:  #FFFFFF ;
    text-decoration
:  none ;
    cursor
:  hand ;
}

a.a2:hover 
{
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    font-weight
:  bold ;
    color
:  #4083D5 ;
    text-decoration
:  none ;
    cursor
:  hand ;
    background-color
:  #FFFFFF ;
}

.TextBox
{
    onfocus
: expression(οnfοcus=function (){this.style.borderColor ='#4083D5' ; } );
    onblur: expression(οnblur=function ()
{ this.style.borderColor='#CCCCCC'; } );
    font-family: Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif;
    font-size: 9pt;
    color: #000000;    
    border: 1pt solid #CCCCCC;
    height: 18px;
}


.Button
{
    onmouseover
: expression(οnmοuseοver=function (){this.style.color='#0a246a' ; } );
    onmouseout: expression(οnmοuseοut=function ()
{ this.style.color='#000000'; } );
    height: 18pt;
    font-family: Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif;
    font-size: 9pt;
    font-weight: normal;
    color: #000000;
}

.DropDownList
{
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    font-weight
:  normal ;
    color
:  #000000 ;
}

.ListBox
{
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    font-weight
:  normal ;
    color
:  #000000 ;
}

.CheckBoxList
{
    padding
:  4px ;
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    font-weight
:  normal ;
    border
:  1pt solid #CCCCCC ;
    color
:  #000000 ;
}

.RadioButtonList
{
    padding
:  4px ;
    font-family
:  Verdana, Lucida, Arial, Helvetica, "宋体", sans-serif ;
    font-size
:  9pt ;
    font-weight
:  normal ;
    border
:  1pt solid #CCCCCC ;
    color
:  #000000 ;
}

skin文件代码如下:

< asp:TextBox  runat ="server"  CssClass ="TextBox"   />
< asp:Button  runat ="server"  CssClass ="Button" />
< asp:DropDownList  runat ="server"  CssClass ="DropDownList" />
< asp:ListBox  runat ="server"  CssClass ="ListBox"   />
< asp:CheckBoxList  runat ="server"  CssClass ="CheckBoxList"   />
< asp:RadioButtonList  runat ="server"  CssClass ="RadioButtonList"   />
< asp:GridView  runat ="server"  CssClass ="TableBG"  BorderWidth ="0"  CellPadding ="5"  CellSpacing ="1" >
    
< RowStyle  CssClass ="ItemStyle"   />
    
< AlternatingRowStyle  CssClass ="AlternateItemStyle"   />
    
< PagerStyle  CssClass ="FooterStyle"   />
    
< HeaderStyle  CssClass ="HeaderStyle"   />
</ asp:GridView >

完整主题文件夹下载: 点击这里下载
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值