ASP.NET2.0 Skin+CSS 测试

本文介绍了一个使用ASPX实现的网页布局示例,详细展示了如何通过内联样式和外部CSS文件来设置不同区块的样式,包括头部、主体和底部等部分,并演示了按钮和日历控件的样式定制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

显示出来如上图:

ASPX页面的代码:
ExpandedBlockStart.gifContractedBlock.gif<%dot.gif@ Page Language="C#" AutoEventWireup="true" CodeFile="SammyDiv.aspx.cs" Inherits="Buying_SammyDiv" Theme = "sammyTest" %>
None.gif
None.gif
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
None.gif
None.gif
<html xmlns="http://www.w3.org/1999/xhtml" >
None.gif
<head runat="server">
None.gif    
<title>Sammy Test Div</title>
ExpandedBlockStart.gifContractedBlock.gif    
<style type ="text/css">dot.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        #rtop
{dot.gif}{       
InBlock.gif        margin
:0 auto;
InBlock.gif        height
:30%;
InBlock.gif        vertical-align
:middle; 
InBlock.gif        text-align
:center;
InBlock.gif        font-family
:Arial; 
InBlock.gif        font-size
:x-large;
InBlock.gif        background
: #CCCC00;
ExpandedSubBlockEnd.gif        
}

InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        #rbottom
{dot.gif}{        
InBlock.gif        margin
:0 auto;
InBlock.gif        height
:70%;
InBlock.gif        vertical-align
:middle; 
InBlock.gif        text-align
:center;
InBlock.gif        font-family
:Arial; 
InBlock.gif        font-size
:x-large;
InBlock.gif        background
: #CCee00;
ExpandedSubBlockEnd.gif        
}

InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        #left
{dot.gif}{        
InBlock.gif        float
:left;
InBlock.gif        height
:100%;
InBlock.gif        width
:50%;    
InBlock.gif        vertical-align
:middle; 
InBlock.gif        text-align
:center; 
InBlock.gif        font-family
:Arial; 
InBlock.gif        font-size
:x-large;   
InBlock.gif        background
: #CCCCed;
ExpandedSubBlockEnd.gif        
}

InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        #container
{dot.gif}{        
InBlock.gif        width
:900px;  
InBlock.gif        height
:600px;   
InBlock.gif        vertical-align
:middle; 
InBlock.gif        text-align
:center; 
InBlock.gif        font-family
:Arial; 
InBlock.gif        font-size
:x-large;  
InBlock.gif        background-color
:Green
ExpandedSubBlockEnd.gif        
}

InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        #leftside
{dot.gif}{
InBlock.gif        width
:40%;
InBlock.gif        height
:60%;
InBlock.gif        float
:left;
InBlock.gif        font-family
:Arial; 
InBlock.gif        font-size
:x-large;
InBlock.gif        vertical-align
:middle; 
InBlock.gif        text-align
:center;
InBlock.gif        background
: gray;
ExpandedSubBlockEnd.gif        
}

InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        #rightside
{dot.gif}{
InBlock.gif        width
:60%;
InBlock.gif        height
:60%;
InBlock.gif        float
:left;
InBlock.gif        vertical-align
:middle; 
InBlock.gif        text-align
:center;
InBlock.gif        font-family
:Arial; 
InBlock.gif        font-size
:x-large;
InBlock.gif        background
: #Cdfd00;
ExpandedSubBlockEnd.gif        
}

InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        #foot
{dot.gif}{
InBlock.gif        height
:20%;
InBlock.gif        clear
:both;
InBlock.gif        vertical-align
:middle; 
InBlock.gif        text-align
:center;
InBlock.gif        font-family
:Arial; 
InBlock.gif        font-size
:x-large;
InBlock.gif        background-color
:InactiveBorder;
ExpandedSubBlockEnd.gif        
}

ExpandedSubBlockStart.gifContractedSubBlock.gif        #header
{dot.gif}{
InBlock.gif        height
:20%;
InBlock.gif        clear
:both;
InBlock.gif        vertical-align
:middle; 
InBlock.gif        text-align
:center;
InBlock.gif        font-family
:Arial; 
InBlock.gif        font-size
:x-large;
InBlock.gif        background-color
:Red
ExpandedSubBlockEnd.gif        
}

InBlock.gif       
InBlock.gif
ExpandedBlockEnd.gif    
</style>
None.gif
</head>
None.gif
<body>
None.gif    
<form id="formtest" runat="server">
None.gif    
<div  id="container">
None.gif        
<div id="header">
None.gif            header   
None.gif        
</div>
None.gif        
<div id="midbody">
None.gif          
<div id="leftside">
None.gif                leftside                
None.gif              
<br />
None.gif              
<asp:Calendar ID="Calendar1" runat="server"/>
None.gif              
<br />
None.gif          
</div>
None.gif          
<div id="rightside">         
None.gif             
<div id="rtop">
None.gif                right top
None.gif                
<div style = "height: 500;">
None.gif                    
<asp:Button ID = "ButtonTest" runat = "Server" Text = "Test"/>
None.gif                    
<asp:Button ID = "Button1" runat = "Server" Text = "Test"/>
None.gif                    
<asp:Button ID = "Button2" runat = "Server" Text = "Test"/>
None.gif                    
<asp:Button ID = "Button3" runat = "Server" Text = "Test"/>
None.gif                
</div>
None.gif             
</div>
None.gif             
<div id="rbottom">
None.gif                 
<div id="left">
None.gif                    left
None.gif                    
<div>
None.gif                        
<asp:Button ID = "Button4" runat = "Server" Text = "Test"/>
None.gif                        
<asp:Button ID = "Button5" runat = "Server" Text = "Test"/>
None.gif                        
<asp:Button ID = "Button6" runat = "Server" Text = "Test"/>
None.gif                        
<asp:Button ID = "Button7" runat = "Server" Text = "Test"/>
None.gif                    
</div>
None.gif                 
</div>
None.gif                 
<div id="right">
None.gif                    right
None.gif                    
<div style ="float:right">
None.gif                        
<h3>Disabling Themes for a Control</h3>
None.gif                        
<asp:Label ID="Label4" runat="server" Text="Hello 1" /><br />
None.gif                        
<asp:Label ID="Label5" runat="server" Text="Hello 2" EnableTheming="False" /><br />
None.gif                        
<asp:Label ID="Label6" runat="server" Text="Hello 3" /><br />
None.gif                    
</div>
None.gif                 
</div>
None.gif             
</div>
None.gif          
</div>
None.gif        
</div>
None.gif        
<div id="foot">
None.gif            foot           
None.gif        
</div>
None.gif        
</div>
None.gif    
</form>
None.gif
</body>
None.gif
</html>
Skin.skin中的代码:
None.gif<asp:Button  runat = "Server" CssClass = "button60"/>
None.gif
None.gif
<asp:Label Font-Bold="true" ForeColor="orange" runat="server" />
None.gif
None.gif
<asp:Calendar BackColor="White" BorderColor="Black" BorderStyle="Solid" CellSpacing="1"
None.gif  Font-Names
="Verdana" Font-Size="8pt" ForeColor="Black" Height="250px" 
None.gif  NextPrevFormat
="ShortMonth" Width="330px" runat="server">
None.gif  
<SelectedDayStyle BackColor="#333399" ForeColor="White" />
None.gif  
<OtherMonthDayStyle ForeColor="#999999" />
None.gif  
<TodayDayStyle BackColor="#999999" ForeColor="White" />
None.gif  
<DayStyle BackColor="#CCCCCC" />
None.gif  
<NextPrevStyle Font-Bold="True" Font-Size="8pt" ForeColor="White" />
None.gif  
<DayHeaderStyle Font-Bold="True" Font-Size="8pt" ForeColor="#333333" Height="8pt" />
None.gif  
<TitleStyle BackColor="#333399" BorderStyle="Solid" Font-Bold="True" Font-Size="12pt"
None.gif    ForeColor
="White" Height="12pt" />
None.gif
</asp:Calendar>
Style.CSS中的代码:
None.gif .button60
None.gif{
None.gif    font-weight: bold;
None.gif    font-size: 12pt;
None.gif    background-image: url(../Images/EPS_Button_BG_60.gif);
None.gif    width: 60px;
None.gif    cursor: hand;
None.gif    color: Blue;
None.gif    height: 50px;
None.gif    
None.gif    text-align: center;
None.gif    border-style: none;
None.gif}

转载于:https://www.cnblogs.com/songsh96/archive/2007/02/28/659746.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值