ASP.net 页面设计

来源:互联网 发布:频率测试软件 编辑:程序博客网 时间:2024/05/17 01:45

css文件内容:

body
{
    padding:0;
    margin:0;
    }
.table1
{
    width:100%;
    cellpading:0;
    cellspacing:0;
    }

aspx文件内容:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="Wvti.Test.login" %>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <%--直接将对应的css文件拖到此处即可,就可调用对应css文件里的样式 --%>
    <link href="css/page.css" rel="stylesheet" type="text/css" />
</head>
<body ><%-- 其效果是将table中的内容紧贴浏览器的边框--%>
    <form id="form1" runat="server">
    <div > <%-- 设置表格的宽和高,背景颜色,表格网线的宽度,单元格内的内容与单元格边框的距离,单元格与边框之间的距离--%>
      <table  height="100%" class="table1">
        <tbody>
          <tr >
            <td width="100%" height="40" bgcolor="#02f78e"></td>
          </tr>
          <tr>
           <td> <%-- 如果不再写一个表格,则若第一行中的列数和第二行的列数不同,将发生错位,
           即第一行有两列,第二行有三列,则第一行的前两列和第二行的前两列将对其,第三行的
           第三列空间无法控制
           --%>
             <table  height="100%" class="table1">
               <tbody>
                 <tr>
                    <td width="20%" height="20">
                    </td>
                    <td align="center" width="60%" height="20">
                      <h1>欢迎登陆本系统</h1>
                    </td>
                    <td width="20%" height="20">
                    </td>
                 </tr>
               </tbody>
             </table>
           </td>
          </tr>
          <tr>
            <td>
              <table  height="300" class="table1">
                <tbody>
                  <tr>
                    <td width="20%" height="300">
                    </td>
                    <td width="60%" height="300">
                      <table  height="300" class="table1">
                        <tbody>
                          <tr>
                            <td  align="center">
                              <asp:GridView ID="GV1" runat="server" AutoGenerateColumns="false">
                      
                              </asp:GridView>
                            </td>
                          </tr>
                       </tbody>
                     </table>
                   </td>
                    <td width="20%" height="300">
                      <table height="300" class="table1">
                        <tbody>
                          <tr>
                            <td>
                            
                            </td>
                          </tr>
                        </tbody>
                      </table>
                    </td>
                  </tr>
                </tbody>
              </table>
            </td>
            
          </tr>
          <tr>
            <td>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div>
      <table width="100%" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td align="center" width="100%">
              版权所有
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    </form>
</body>

</html>


原创粉丝点击