我正在尝试学习无桌子设计,并且在一些应该很容易的事情上遇到了困难
我正在尝试在设计器的屏幕右下角创建一个保存或取消按钮,它看起来不错,但在浏览器(IE 和 Chrome)中,按钮移动到表单的右侧
我已经尝试过高度自动并将其全部排除在外。如果我修复了主 div 的高度,那么它可以工作,但我并不总是知道那个高度。无论如何让按钮在主 div 的底部“流动”?
谢谢你
编码
<%@ Page Title="" Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" CodeBehind="NewAccount.aspx.cs" Inherits="BudgetApplicationCSharp.NewAccount" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css" media="screen">
#container
{
width:500px;
margin: 5px;
}
#main
{
width:500px;
height:auto;
margin:1px;
}
#left
{
float:left;
width:50%;
padding-left:0px;
margin:0px;
}
#right
{
float:right;
width:50%
}
ol
{
list-style:none;
}
input[type=button]
{
float:right;
clear:right;
}
input[type=Text]
{
font:15px "MS Sans Serif";
}
label
{
font:15px "MS Sans Serif";
}
fieldset
{
padding:0px;
margin:0px;
border:0px none;
}
ol
{
padding:0px;
margin:0px;
border:0px none;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="container">
<div id="main">
<div id="left">
<fieldset>
<ol>
<li>
<label for="AccountName">
Account Name</label>
<input id="AccountName" runat="server" />
</li>
<li>
<label for="Description">
Description</label>
<input id="Description" runat="server" />
</li>
<li>
<label for="InstituteName">
Institute Name</label>
<input id="InstituteName" runat="server" />
</li>
<li>
<label for="AccountType">
Institute Name</label>
<select id="cboAccountType" runat="server">
</select>
</li>
</ol>
</fieldset>
</div>
<div id="right">
<fieldset>
<ol>
<li>
<label for="AccountNumber">
Account Number</label>
<input id="AccountNumber" runat="server" />
</li>
<li>
<label for="RoutingNumber">
Routing Number</label>
<input id="RoutingNumber" runat="server" />
</li>
</ol>
</fieldset>
</div>
</div>
<div id="buttons">
<input id="btnSave" type="button" value="Save" runat="server" />
<input id="btnCancel" type="button" value="Cancel" runat="server" />
</div>
</div>
</asp:Content>