Html 尝试在标题元素之间添加分隔行
我试图在这些下拉列表、标签和按钮之间画一条线。在这张照片中: 我想用一条线把它们分开,就像这样: 以下是我尝试使用的div,以实现这一行:Html 尝试在标题元素之间添加分隔行,html,css,asp.net,border,Html,Css,Asp.net,Border,我试图在这些下拉列表、标签和按钮之间画一条线。在这张照片中: 我想用一条线把它们分开,就像这样: 以下是我尝试使用的div,以实现这一行: <div style="float: left; border-right: 1px solid black; height: 100%;"></div> 使用一些样式=“边框左:实心1px×000;每个div可以工作。什么是简单的,我不是CSS母版,但也许使用最后一个子伪选择器的想法可以帮助您。考虑小于IE9的浏览器将
<div style="float: left; border-right: 1px solid black; height: 100%;"></div>
使用一些<代码>样式=“边框左:实心1px×000;每个div可以工作。
什么是简单的,我不是CSS母版,但也许使用最后一个子伪选择器的想法可以帮助您。考虑小于IE9的浏览器将不支持该选择器。但是您也可以将一个类添加到您的最后一个元素以达到相同的效果: Html.wrapper div{
浮动:左;
填充物:5px;
左边框:1px纯黑;
边框顶部:1件纯黑;
边框底部:1px纯黑;
高度:40px;
文本对齐:居中;
}
.wrapper div:最后一个孩子{
右边框:1px纯黑;
}
输入
标签{
显示:块;
}
一些文本
银行
示例选项
树枝
示例选项
可能希望提供简单的html(因为这个问题实际上与aspnet没有任何关系)以及将css分离到一个文件(取消内联样式)。这使我的标签位于标题下方。我添加了我用于样式设置的css
<section class="featured">
<div id="HomeScreenHeader" runat="server" class="content-wrapper-header">
<div id="HomeScreenActionButton">
<div onclick="window.onbeforeunload = false;">
<div style="float:right; margin-right:2px; margin-top:15px;">
<asp:Button ID="btnValidateTotals" runat="server" OnClick="btnValidateTotals_Click" style="line-height:12px;" CssClass="statusbutton"/>
</div>
<div style="float:right; margin-right:2px; margin-top:15px;">
<asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClientClick="return window.confirm('Are you sure you want to leave? Any unsaved changes will be lost.');" OnClick="btnCancel_Click" style="line-height:10px; " CssClass="statusbutton" />
</div>
</div>
</div>
<div id="HomeScreenBranch" class="branch">
<div style="margin-left:auto; margin-right:auto; text-align: center;"><asp:Label ID="lblHSBranch" runat="server" Text="<u>Branch</u>"></asp:Label></div>
<asp:DropDownList ID="ddlHSBranch" runat="server" Width ="180" ></asp:DropDownList>
</div>
<div class="bank">
<div style="margin-left:auto; margin-right:auto; text-align: center;"><asp:Label ID="lblHSBank" runat="server" Text="<u>Bank</u>"></asp:Label></div>
<asp:DropDownList ID="ddlHSBank" runat="server" AutoPostBack="true" Width ="180" OnSelectedIndexChanged="ddlHSBank_SelectedIndexChanged"></asp:DropDownList>
</div>
<div class="teller">
<asp:Label ID="lblteller" runat="server" Text="Teller:"></asp:Label>
</div>
</div>
</section>
.branch {
float:right;
width:180px;
height: 28px;
font-size: 1.2em;
color: #FFF;
margin-right:10px;
margin-bottom:50px;
}
.bank {
float:right;
width:180px;
height: 29px;
margin-right:10px;
font-size: 1.2em;
color: #FFF;
margin-bottom:10px;
}
.teller{
float:left;
width:120px;
height: 100px;
margin-left:10px;
margin-right:10px;
font-size: 1.2em;
color: #FFF;
}