473,385 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Please help with (hopefully) simple box login form layout?

Again: struggling to convert old-style HTML to html using css.

I am trying to create a rectangular box divided into approx three vertical
sections. The top section contains an image I would like on the extreme
left of the box, the text centered in the reamaining space in that section.

The center third contains two lines prompting for a user's login and
password with a thirdline with some info (this section actually look OK
now).

The bottom third section again has an image I would like on the extreme left
with the two submit buttons appearing to the right of it.

The difficulties I am having are primarily left/center positioning and
getting the text to align with the middle of the images (i.e.:
valign=middle which is deprecated).

I am including my HTML code snippets as well as css snippets.

Can someone please advise as to what needs to be altered to achieve the
desired look/effects? Thank you - I am a quick understudy!

HTML snippet:

print "
<!-- Main Login Prompt Section -->
<div id=\"pv00\">
<h2 style=\"margin-left: 30%\">Welcome to $D</h2>
<fieldset style=\"width: 400px; text-align: center; margin-left: 20%;
margin-right: auto;\" >
<form name=\"login\" action=\"sc_login.php?s=1&$N&$D\" method=\"post\" >
<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" >
<tr>
<td id=\"login_top\">
<span class=\"login_left\"><img src=\"pix/ss_keys.png\" width=\"40\"
height=\"40\" alt=\"keys\" border=\"0\" /></span>
<span class=\"login_center\">Login to: $D</span>
</td>
</tr>
<tr>
<td>
<table align=\"center\" summary=\"\" >
<tr>
<td align=\"left\"><strong>Login:</strong></td>
<td><input name=\"_Userid\" type=\"text\" value=\"$_Userid\"
size=\"15\" maxlength=\"15\" /></td>
</tr>
<tr>
<td align=\"left\"><strong>Password:</strong></td>
<td><input name=\"_Passwd\" type=\"password\" value=\"$_Passwd\"
size=\"15\" maxlength=\"15\" /></td>
</tr>
<tr>
<td colspan=\"2\" align=\"center\"><small>Please user your normal
login information.</small></td>
</tr>
</table>
<span class=\"red\">$eMsg</span><br />
</td>
</tr>
<tr>
<td>
<img src=\"pix/ss_logo.png\" width=\"184\" height=\"44\" alt=\" SS
Logo\" border=\"0\" />
<input type=\"submit\" name=\"_Btn1\" value=\"Login\" />
<input type=\"button\" name=\"_Btn1\" value=\"Quit\"
onclick=\"location.href='sc00.php'\" />
</td>
</tr>
</table>
</form>
</fieldset>
</div>
<!-- End of Login Prompt Section -->
css code snippet:

/* Common Login Prompt */
#login_top {
height: 45px;
background-color: #990033;
color: #ffffff;
font-size: 14px;
vertical-align: middle;
}
..login_left {
text-align: left;
vertical-align: middle;
}
..login_center {
text-align: center;
vertical-align: middle;
}
Feb 2 '07 #1
1 6971
On 2007-02-02, bobmct <bo*****@gmail.comwrote:
Again: struggling to convert old-style HTML to html using css.

I am trying to create a rectangular box divided into approx three vertical
sections. The top section contains an image I would like on the extreme
left of the box, the text centered in the reamaining space in that section.

The center third contains two lines prompting for a user's login and
password with a thirdline with some info (this section actually look OK
now).

The bottom third section again has an image I would like on the extreme left
with the two submit buttons appearing to the right of it.
The way to do this with tables is to put the left image in its own
column (i.e. <td>). Set the width of that column explicitly to the width
of the image, and set the overall width of the table. The other column
will get the rest of the width automatically. You can give the cell in
the second column text-align: center to make its inline contents
centered.

text-align applies to block boxes, and determines how the inline boxes
in them are aligned. It's no good setting text-align: left on an inline
box to make it go to the left, with another inline box on the same line
with text-align: center. It doesn't work like that. You can float a box
to the left within a container whose inline boxes are centered
(text-align: center on the container); but they will be centered with
respect to the total width, not to the space available to the right of
the float. All the same, that might look acceptable, so you could try
it. But you won't easily be able to get "Login in $D" aligned vertically
to the centre of the image if you use a float.
The difficulties I am having are primarily left/center positioning and
getting the text to align with the middle of the images (i.e.:
valign=middle which is deprecated).
You can just use vertical-align: middle in the styles for <tdinstead.
Feb 2 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: tencip | last post by:
Hi everyone, So, i've got a form that is very simple. It hold three elements: username, password, and domain. The goal here is to have the form submit the login to an administrative section...
6
by: Stan Sainte-Rose | last post by:
Hi, I m looking for a good example with asp.net (the best will be a vb.net code) for how to make and use a web template. With ASP, I used "include", and I know it's impossible with asp.net ...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
1
by: ugo.matrangolo | last post by:
Hi, I'm trying to write a site to manage a scientific conference (submitting paper, reviews, etc.) for a friend. The application is almost finished but i have a little problem with its page...
9
by: Bob Alston | last post by:
I am looking for electronic forms software that would integrate well with MS Access. I have a client for whom I built a client database to replace and update one they had that was obsolete and...
0
by: Sergio E. | last post by:
Hello, I have a problem with masterpages and forms security. I made a new Web site, in which I have my page of login like of beginning, a master page with only a sitemappath object in it, the...
8
by: | last post by:
I'm looking for some design guidance on a collection of projects I'm working on. The project involves a bunch of websites constructed out of a collection of user controls. Different user...
1
by: cnixuser | last post by:
Hello, I am currently attempting to implement a simple actionlistener for a button in a JFrame that was created via "drag and drop" with the Netbeans 5.0 IDE, the code that I am using to implement...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.