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>

    完整主题文件夹下载:点击这里下载
  • 相关阅读:
    【leetcode】1215.Stepping Numbers
    【leetcode】1214.Two Sum BSTs
    【leetcode】1213.Intersection of Three Sorted Arrays
    【leetcode】1210. Minimum Moves to Reach Target with Rotations
    【leetcode】1209. Remove All Adjacent Duplicates in String II
    【leetcode】1208. Get Equal Substrings Within Budget
    【leetcode】1207. Unique Number of Occurrences
    【leetcode】689. Maximum Sum of 3 Non-Overlapping Subarrays
    【leetcode】LCP 3. Programmable Robot
    【leetcode】LCP 1. Guess Numbers
  • 原文地址:https://www.cnblogs.com/lovecherry/p/861566.html
Copyright © 2011-2022 走看看