I've used this previously and it worked fine. However, in this case, the label and input box won't align vertically. This is when viewed in Design View of VS.
For some reason the Label text is lying slightly below the line of the textbox. I've tried adding a line-height to both, which helps to a degree, but it still doesn't look right to my eye. The text is still slightly below vertical alignment.
CSSCode:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="Ascent.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/login.css" rel="stylesheet" type="text/css" /> <link href="css/text.css" rel="stylesheet" type="text/css" /> <link href="css/master.css" rel="stylesheet" type="text/css" /> <title>Login</title> </head> <body> <form id="form1" runat="server"> <div id="holder"> <div id="logo"> </div> <div id="main"> <div id="padlock"> </div> <div id="content" class="size_10 bold blue_333399"> THIS IS A SECURE SITE.<br /> UNAUTHORISED ACCESS IS NOT PERMITTED <div style="text-align:top; vertical-align:middle;"> <ul id="login" class="input-fields"> <li> <asp:Label ID="lblUserName" runat="server" Text="Username" /> <asp:TextBox ID="txtUserName" runat="server" CssClass="textbox" Width="200px" MaxLength="15" /> </li> </ul> </div> </div> </div> </div> </form> </body> </html>
Like I say, I've used this before and everything aligned fine.Code:body { width:100%; height:100%; } ul.input-fields { width:100%; list-style-position: outside; list-style-type: none; margin: 0 auto 3px auto; padding: 0; } ul.input-fields li { margin: 0; text-align:left; } ul.input-fields label, ul.input-fields span { text-align:right; display: inline-block; min-width:15em; width: 40%; } ul.input-fields input, ul.input-fields select, ul.input-fields textarea { margin: 2px 0; } input.textbox { margin:0; border:solid 1px #CCCCCC; background-color: #EDF0FD; } #holder { text-align:center; vertical-align:middle; width:50%; height:50%; border:solid 1px #CCCCCC; } #logo { height:100px; width:357px; background-image:url('../images/logo.jpg'); background-repeat:no-repeat; } #main { margin:0; margin-top:20px; width:100%; margin-left:auto; margin-right:auto; } #padlock { margin-top:-20px; float:left; height:128px; width:90px; background-image:url('../images/padlock.png'); background-repeat:no-repeat; } #content { float:right; text-align:center; }
Don't know if it's something I need to change with the holding div or what. If I just put text in the <li> it appears fine. As soon as I add a textbox control, the alignment goes.
Any ideas?



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks