zoukankan      html  css  js  c++  java
  • 使用主题来自动包装控件样式

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

    建立一个主题文件夹,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(onfocus=function (){this.style.borderColor ='#4083D5';});
        onblur: expression(onblur=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(onmouseover=function (){this.style.color='#0a246a';});
        onmouseout: expression(onmouseout=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>

    完整主题文件夹下载:点击这里下载
  • 相关阅读:
    泛型的模板思想
    GTD:是一种态度
    如何debug android cts
    POJ 3352 无向图边双连通分量,缩点,无重边
    Oracle—用户管理的备份(一)
    Retinex processing for automatic image enhancement 翻译
    myBatis抛出异常Result Maps collection already contains value ...
    xxx cannot be resolved to a type 错误解决方法
    Cannot change version of project facet Dynamic Web Module to 3.0
    mysql JDBC URL格式各个参数详解
  • 原文地址:https://www.cnblogs.com/lovecherry/p/861566.html
Copyright © 2011-2022 走看看