zoukankan      html  css  js  c++  java
  • div水平垂直居中

    css样式:

    插播一下 让checkbox字体和框在同一条水平线上的样式
    .checkbox
    {
        vertical-align: middle;
        margin-top: 0;
        line-height: 24px;
        margin-bottom: 2px;
    }

    /*
    div水平垂直居中*/ .topdiv { text-align:center; } .insidediv1 { position:absolute; left:50%; top:50%; margin-left:width/2; margin-top:height/2; } .insidediv2 { background-color:Yellow; width:300px; height:180px; margin-left:-150px; /*对应数值是width的二分之一*/ margin-top:-90px; /*对应数值是height的二分之一*/ }

     aspx或html页面:

    <body>
        <form id="form1" runat="server">
        <div class="topdiv">
            <div class="insidediv1">
                <div class="insidediv2">
                    <table cellpadding="0" cellspacing="0" class="table">
                        <tr>
                            <td>
                                登 录 名:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtLoginName" runat="server" Width="150px" Height="26px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" Width="150px" Height="26px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btnLogin" runat="server" Text="登录" OnClick="btnLogin_Click" />
                            </td>
                            <td>
                                <asp:Button ID="btnReset" runat="server" Text="重置" OnClick="btnReset_Click" />
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        </form>
    </body>
  • 相关阅读:
    hdu2574 Hdu Girls' Day (分解质因数)
    python------logging模块
    python之异常
    python之反射
    python面向对象之封装
    python之面向对象2
    pyhton之路---面向对象
    python之路模块与包
    python常用模块
    匿名函数
  • 原文地址:https://www.cnblogs.com/zhizihuakai/p/2811035.html
Copyright © 2011-2022 走看看