标签在调整大小时已更改其位置 [英] label has changed its position when resizing
本文介绍了标签在调整大小时已更改其位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我调整窗口标签的大小时,其位置已更改.
代码是
When I resize the window label has changed its position.
code is
<asp:Label ID="Label11" runat="server" BackColor="#99CCFF" Font-Bold="True"
Font-Size="XX-Large" Text="Add the Category of Item" Font-Underline="true"
Width="355" style="position: relative"></asp:Label>
我希望它不会更改.
I want it does not changed.
推荐答案
尝试一下.发生这种情况是因为您将位置设置为相对位置,该位置根据父conainer容器而变化.
try this. it is happening because you set position as relative which changes according to parentconainercontainer.
style="position:fixed"
1.在ASP.NET中设计任何页面时,请始终以< td>< tr> 结构进行设计
2.在百分比(%)中使用高度和宽度,而不在 Px
中使用高度
请参阅以下示例
1. When you design any page in ASP.NET then always design it in <td><tr> structure
2. Use height and Width in Percentage(%) not in Px
see the below example
<form id="frm1" runat="server">
<Table width="100%">
<td>
<tr align="right">
<asp:Label ID="Label11" runat="server" BackColor="#99CCFF" Font-Bold="True" Font-Size="XX-Large" Text="Add the Category of Item" Font-Underline="true">
</asp:Label>
</tr>
</td>
</table>
</form>
您不必使用 position:相对
You need not have to use position: relative
尝试一下
Try this
<div style="float:right;">
<asp:label id="Label3" runat="server" xmlns:asp="#unknown" />
</div>
其他
else
<asp:label id="Label3" style="float:right;" runat="server" xmlns:asp="#unknown" />
根据需要使用左侧或右侧
use left or right as you need
这篇关于标签在调整大小时已更改其位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文