Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I resize the window label has changed its position.
code is

XML
<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.
Posted
Updated 12-Dec-11 0:02am
v2

try this. it is happening because you set position as relative which changes according to parent conainer container.
HTML
style="position:fixed"
 
Share this answer
 
v2
Comments
Monjurul Habib 12-Dec-11 11:45am    
good call, 5!
Fatin Fatin Fatin 14-Feb-23 1:59am    
thanks
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

XML
<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>


You need not have to use position: relative
 
Share this answer
 
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
 
Share this answer
 
Hi,


it's all depend upon your UI and control position , if you provide snapshot or any idea about your UI then we can help you in correct direction.

you can also use TABLE structure instead of DIV based to properly align your page.

Thanks
-Amit.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900