.net设置div居中占整个屏幕的80%

    科技2023-12-24  99

    .net 设置div居中占整个屏幕的80%

    A.aspx 页面代码

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="news_show.aspx.cs" Inherits="news_show" %> <!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> <style> .hw { width: 50%; align: center; float: left; } .son { position:absolute; left: 10%; right: 10%; } .father { position:relative; } </style> </head> <body style="background-color: #E6E6FA;"> <form id="form1" runat="server"> <div class="father"> <div style="text-align: center;"> <asp:Label ID="title" runat="server"></asp:Label> </div> <div class="son"> <div style="text-align: left;" class="hw"> 新闻类型:<asp:Label ID="menu" runat="server"></asp:Label> </div> <div style="text-align: right;" class="hw"> 发布日期:<asp:Label ID="adddate" runat="server"></asp:Label> </div> </div> <div class="son"> <asp:Label ID="more" runat="server"></asp:Label> </div> </div> </form> </body> </html>
    Processed: 0.018, SQL: 8