Solved

IIS vs Firefox for a page

Posted on 2008-10-18
3
214 Views
Last Modified: 2010-08-05
This is my login page, when I view it under Firefox / Chrome the textboxes line up, but with IE6 the username field is wider than the password field. Any ideas why this would be happening?




<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="login.aspx.vb" Inherits="myproject.login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">
    <link href="css/contentpage.css" rel="stylesheet" type="text/css" />
    <title>Login</title>
</head>
<body style="background-color: Black">
    <form id="form1" runat="server">
    <div style="position:absolute; left:50%; margin-left:-146px; top:0%; margin-top:100px; width: 292px; height: 305px; border-style:solid; border-width: 0px">
        <img src="images/login.jpg" />
    </div>    
    <div style="position:absolute; left:50%; margin-left:-150px; top:0%; margin-top:450px; width: 300px; border-style:solid; border-width: 0px">
   
        <asp:Label ID="lblUsername" runat="server" Text="Username" Width="125px"></asp:Label>
        <asp:TextBox ID="tbUsername" runat="server"></asp:TextBox>
        <br />
        <asp:Label ID="lblPassword" runat="server" Text="Password" Width="125px"></asp:Label>
        <asp:TextBox ID="tbPassword" runat="server" TextMode="Password"></asp:TextBox>
        <br />
        <asp:Label ID="lblPassword0" runat="server" Width="125px" Text="Login" style="color:Black;"></asp:Label>
        <asp:Button ID="btnLogin" runat="server" Text="Login" Width="80px" />
   
        <br />
        <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
   
        <br />
        <br />
   
    </div>
    </form>
</body>
</html>


0
Comment
Question by:craigdev
  • 2
3 Comments
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 22749605
You haven't said how much wider.  If only a small amount, use CSS to limit the form and input field margins

FORM  { margin:0px; padding:0px }
INPUT  { margin:0px; padding:0px }

If a lot more, it will be to do with your DIV layout.  
0
 
LVL 1

Author Comment

by:craigdev
ID: 22749907
it's about 20px - what is wrong with my div layout?
0
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 500 total points
ID: 22749973
nothing is necessarily "wrong" with it.  It is not a matter of right and wrong, it is a matter of the fact that some browsers will take more space for an input field if the space is there.  You have 2 input boxes of 125 wide in a DIv of 300px wide, so IE6 and other browsers will take more room if they have it.  First you need to try the form and input styling above.  Then you should set a max width to the input fields, and if steps 1 and 2 don't fix the problem, then narrow the DIV and put display:inline in its CSS styling.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question