【发布时间】:2014-05-20 00:00:09
【问题描述】:
在我的 asp.net 页面上,我有一些 Update Pannel。为了避免异步回发的问题,我必须将我的Print Button 放在面板外,但我的按钮的所有其他标签和图像仍在此面板内,所以我想控制 CSS 中的页面样式以放置我的 btnPrint就在image1 旁边。
这是我的页面布局:
<div id="Toolbar">
<asp:UpdatePanel ID="UpdateToolbar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label3" runat="server" Text=" Months: "></asp:Label>
<asp:DropDownList ID="ddlMonth" runat="server"></asp:DropDownList>
<asp:Label ID="Label2" runat="server" Text=" Year: "></asp:Label>
<asp:DropDownList ID="ddlYear" runat="server"></asp:DropDownList>
<b id="buttonWrap">>
<asp:Image ID="Image2" runat="server" ImageUrl="Images/DefRefreshBtn.png" Width="15"
Height="20" />
<asp:LinkButton ID="btnRefresh" runat="server" OnClick="btnRefresh_Click1">Refresh</asp:LinkButton>
<asp:Image ID="Image1" runat="server" ImageUrl="Images/DefPrintBtn.png" Width="27"
Height="20" />
</b>
</ContentTemplate>
</asp:UpdatePanel>
<asp:LinkButton ID="btnPrint" runat="server" onclick="btnPrint_Click" CssClass="printBtn">Print</asp:LinkButton>
</div>
目前,我正在使用这个CssClass="printBtn":
.printBtn
{
position: relative;
top: -23px;
right: -700px;
font-weight: bold;
}
但这种硬编码可能会导致不同浏览器出现问题。有什么方法可以在 CSS 中将我的按钮指定在 image1 旁边吗?
【问题讨论】:
-
需要实际输出的 HTML。
-
向我们展示 html 的实际渲染,请不要使用
asp代码作为设计人员想要回答您的问题
标签: html css asp.net position css-position