Click here to Skip to main content
15,887,945 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a website in ASP.NET. I have the background fixed. The Asp.net elements needs to be aligned to any resolution. Right now I am using 1440*900 as my test resolution. very thing lines up great on that one but when I move it to another screen that has resolution at 1920*1080 the alignment is off. How can I correct this to fit any resolution on any computer?

Here is my HTML code:

HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"  runat="server">
    <title>SACSCOC Login</title>
    <style type="text/css">
        .style1
        {
            font-size: x-large;
            }
        .style2
        {
            width: 100%;
            height: 130px;
        }
        .style3
        {
            width: 655px;
            text-align: right;
        }
        .style4
        {
            width: 407px;
            text-align: left;
        }
        .style5
        {
            text-align: left;
        }
        .style6
        {
            width: 188px;
            text-align: center;
        }
        .style10
        {
            color: #0000FF;
        }
        .style11
        {
            width: 100%;
        }
        #form1
        {
            text-align: center;
        }
        .style12
        {
            font-weight: bold;
        }
        .style13
        {
            width: 188px;
            text-align: left;
        }
        .style14
        {
            text-align: left;
            width: 1750px;
        }
        .style15
        {
            width: 143px;
        }

        body { 
    background-image: url('Images/bkg-blu.jpg');
    background-attachment: fixed;
    background-position: center; 
}
    </style>
</head>
<body background="Images/bkg-blu.jpg">
    <form id="form1"  runat="server">
    <div class="style1">
        <table class="style11">
            <tr>
                <td class="style14">
                    </td>
                <td>
                     </td>
            </tr>
        </table>
        <br />
        </span><br />
        </strong>
    
    </div>
    <table class="style2">
        <tr>
            <td class="style3">
                ^__strong>UserName / Email Address</td>
            <td class="style13">
                <asp:TextBox ID="TextBoxEA" runat="server" MaxLength="50" Width="180px" >
                </asp:TextBox>
            </td>
            <td class="style5">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="TextBoxEA" ErrorMessage="You Must Enter A UserName" 
                    ForeColor="Red" CssClass="style12"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style3">
                ^__strong>Password</td>
            <td class="style13">
                <asp:TextBox ID="TextBoxPW" runat="server" TextMode="Password" Width="180px"></asp:TextBox>
            </td>
            <td class="style5">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="TextBoxPW" ErrorMessage="You Must Enter The Password" 
                    ForeColor="Red" CssClass="style12"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style3">
                 </td>
            <td class="style13">
                 </td>
            <td class="style5">
                 </td>
        </tr>
        <tr>
            <td class="style3">
    
        ^__strong style="text-align: left">
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/FINSubmitPage.aspx" 
                    style="text-align: center; font-size: large;">New Password Creation</asp:HyperLink>
        
    
            </td>
            <td class="style6">
                <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Login" 
                    Width="106px" style="text-align: center" />
            </td>
            <td class="style5">
                <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/FINForgotPassword.aspx"
                    
                    style="text-decoration: underline; color: #0000FF; font-weight: 700; font-size: large" 
                    ForeColor="#FFCC00">Forgot Password</asp:HyperLink>
            </td>
        </tr>
    </table>
    <asp:Label ID="lblMessage" runat="server" Font-Bold="True" 
        Font-Names="Times New Roman" Font-Size="Medium" ForeColor="Red"></asp:Label>
    </form>
</body>
</html>


[Re-post of How to Scale your entire website and its Elements to any Browsers Size?[^] — SA]
Posted
Updated 12-May-15 5:01am
v2
Comments
Richard Deeming 12-May-15 10:57am    
REPOST
You have already asked this question and accepted a solution:
http://www.codeproject.com/Questions/990448/How-to-Scale-your-entire-website-and-its-Elements[^]

Re-posting the same question isn't going to change the answer!

1 solution

Please read my past answer paying more attention: How to Scale your entire website and its Elements to any Browsers Size?[^].

—SA
 
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