嗨,我试着用面板做一个盒子,盒子里面有4个盒子。
<asp:Panel ID="Panel1" CssClass="onthefly" runat="server" BackColor="#4A4A4A" Height="469px"
Width="476px">
<asp:Panel ID="Panel4" runat="server" CssClass="onthefly1" Height="210px"
Width="235px">
</asp:Panel>
<asp:Panel ID="Panel5" runat="server" CssClass="onthefly" Height="210px"
Width="240px">
<asp:Panel ID="Panel6" runat="server" CssClass="onthefly1" Height="210px"
Width="240px">
</asp:Panel>
<asp:Panel ID="Panel7" runat="server" CssClass="onthefly" Height="210px"
Width="240px">
</asp:Panel>
</asp:Panel>面板的css:
.onthefly
{
display: inline;
float: right;
}
.onthefly1
{
display: inline;
float: left;
}自动柜员机6号盘不在4号盘下面,4-5-7号盘都在正确的位置。
不知道如何让6号面板坐在4号面板下方和7号面板的左边。
发布于 2011-04-04 01:45:05
Garrith,我相信这会让你得到你想要的结果
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.onthefly_container
{
display: inline;
float: right;
width: 476px;
height: 469px;
background-color:#4A4A4A;
border: 1px solid black;
}
.onthefly_left
{
display: inline;
float: left;
width: 238px;
height: 234px;
border: 0px;
}
.onthefly_right
{
display: inline;
float: right;
width: 238px;
height: 234px;
border: 0px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:Panel ID="Panel1" runat="server" CssClass="onthefly_container">
<asp:Panel ID="Panel4" runat="server" CssClass="onthefly_left">4
</asp:Panel>
<asp:Panel ID="Panel5" runat="server" CssClass="onthefly_right">5
</asp:Panel>
<asp:Panel ID="Panel6" runat="server" CssClass="onthefly_left">6
</asp:Panel>
<asp:Panel ID="Panel7" runat="server" CssClass="onthefly_right">7
</asp:Panel>
</asp:Panel>
</form>
</body>
</html>您发布的标记有几个问题:
<div> or </div> everywhere you have <asp:panel> and </asp:panel>。如果没有别的,那就是很少的击键。干杯,
CEC
https://stackoverflow.com/questions/5530791
复制相似问题