Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 12th, 2007, 07:08 AM
Authorized User
Join Date: Feb 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default form labels and input fields alignments

I have designed a form below:
<form id="frm-emailfriend" action="">
<label for="to">To:</label><input name="to" type="text" class="textBox" size="15" /><br />
<label for="from">From:</label><input name="from" type="text" class="textBox" size="15" /><br />
<label for="subject">Subject:</label><input name="subject" type="text" class="textBox" size="25" /><br />
<label for="">&nbsp;</label><input name="to" type="text" class="textBox" size="15" />

The CSS class for the above:
#frm-emailfriend label{

The problem is the labels are not getting right aligned to the input fields in the browser. Please let me know how to get them right aligned?

Shivanand Yerva
Old June 19th, 2007, 02:01 AM
Authorized User
Join Date: Jun 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts

Dear Cyber Shiva

You have used "frm-emailfriend" as id of your form tag. Always remember that using hyphen for 'id' attribute is not possible. Replace "frm-emailfriend" with "frm_emailfriend" and look at your desire layout

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation to input fields amol_0008 XML 1 May 30th, 2007 04:36 AM
address labels to columnar form skrj02 Excel VBA 0 January 2nd, 2007 02:48 PM
Problem with labels and entry fields on same line ectounix CSS Cascading Style Sheets 3 April 3rd, 2006 12:35 PM
hidden input fields and Mozilla panos CSS Cascading Style Sheets 1 February 3rd, 2006 05:45 PM
Labels on form sweet4511 VB How-To 2 July 20th, 2005 11:46 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.