473,394 Members | 1,658 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,394 software developers and data experts.

How to align text label and input field's text ?

Hi,

Here is sample page to show you the problem :

<html><body>
<form action="/cgi-bin/test.cgi" method="post">
Data Path : <input type="text" size="50" value="C:\Test Data\May
2007.xls" style='border: thin solid #FFFFFF'></form>
</body></html>

I would like the text label and text in input field be exactly
vertically aligned in all main browsers : IE, Netscape, Firefox,
Mozilla, Opera, Konqueror, etc.

How to do ?

Jun 11 '07 #1
5 59562
Scripsit Yohan Blurp:
Here is sample page to show you the problem :
It's not a page. It's just a fragment of code. In future, please post a URL.
<html><body>
<form action="/cgi-bin/test.cgi" method="post">
Data Path : <input type="text" size="50" value="C:\Test Data\May
2007.xls" style='border: thin solid #FFFFFF'></form>
</body></html>
I wonder what you expect to achieve, in WWW terms, by using a text input
field initialized to something that looks like a path filename in a
particular computer. Moreover, a form without a submit button is not very
safe, and it looks odd. Besides, you should use <labelmarkup, for
accessibility, to associate the label text with the corresponding field.
I would like the text label and text in input field be exactly
vertically aligned in all main browsers : IE, Netscape, Firefox,
Mozilla, Opera, Konqueror, etc.
That's not an HTML issue but a matter of styling (CSS). Besides, it's not
particularly important, and it's not really possible, due to the different
interpretations and implementations of the vertical-align property. But
_after_ you have created a functional page and tested it, feel free to ask
for ideas on styling in c.i.w.a.stylesheets.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 11 '07 #2
On 11 Jun, 12:10, Yohan Blurp <ybl...@aname.netwrote:
Hi,

Here is sample page to show you the problem :

<html><body>
<form action="/cgi-bin/test.cgi" method="post">
Data Path : <input type="text" size="50" value="C:\Test Data\May
2007.xls" style='border: thin solid #FFFFFF'></form>
</body></html>

I would like the text label and text in input field be exactly
vertically aligned in all main browsers : IE, Netscape, Firefox,
Mozilla, Opera, Konqueror, etc.
<form action="/cgi-bin/test.cgi" method="post">
<label for="x" style="vertical-align: middle">Data Path :</label>
<input type="text" size="50" name="x" value="C:\Test Data\May
2007.xls" style='border: thin solid #FFFFFF; vertical-align: middle'>
</form>

Jun 12 '07 #3
Gazing into my crystal ball I observed Yohan Blurp <yb****@aname.net>
writing in news:MP************************@news.tiscali.fr:
Hi,

Here is sample page to show you the problem :

<html><body>
<form action="/cgi-bin/test.cgi" method="post">
Data Path : <input type="text" size="50" value="C:\Test Data\May
2007.xls" style='border: thin solid #FFFFFF'></form>
</body></html>

I would like the text label and text in input field be exactly
vertically aligned in all main browsers : IE, Netscape, Firefox,
Mozilla, Opera, Konqueror, etc.

How to do ?
Have a look at http://www.intraproducts.com/usenet/requiredform.asp
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jun 12 '07 #4
In article <11*********************@i38g2000prf.googlegroups. com>,
ro*********@gmail.com says...
<form action="/cgi-bin/test.cgi" method="post">
<label for="x" style="vertical-align: middle">Data Path :</label>
<input type="text" size="50" name="x" value="C:\Test Data\May
2007.xls" style='border: thin solid #FFFFFF; vertical-align: middle'>
</form>
Thanks, I've effectively used that
Jun 14 '07 #5
In article <4j********************@reader1.news.saunalahti.fi >,
jk******@cs.tut.fi says...
I wonder what you expect to achieve, in WWW terms, by using a text input
field initialized to something that looks like a path filename in a
particular computer. Moreover, a form without a submit button is not very
safe, and it looks odd. Besides, you should use <labelmarkup, for
accessibility, to associate the label text with the corresponding field.
I've finally used <label>. However, because I didn't used <labelin the
past and, by that way, could know it was possible to apply a vertical-
align here, i could be aware of the fact the right group was about
stylesheet. When you ask a question you don't always know the domain of
solution !
Jun 14 '07 #6

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

Similar topics

4
by: Christian Colberg | last post by:
Hi, I wanted to know how you can insert text to the left and to the right of a marked part of the word. example: Input field says: ... trees are green ... By marking this text and using a...
2
by: Rosebud | last post by:
Hello, I'd like some help trying to generate input fields on the fly. What I have on an HTML page is a single text input field labelled #1, e.g. #1 <input type="text">. Next to the field is a...
1
by: John English | last post by:
Is there a way to catch the Enter key being pressed in a text field? I want to submit the form if Enter is pressed in a particular field. I have more than one form on the page, each with a submit...
11
by: Markus Mueller | last post by:
Hi, I'm using a form with a bunch of input tags to enter numbers. Is there any way to make the input field right adjusted, so that the numbers align at the right side instead of the left? Even...
5
by: Mikko Rantalainen | last post by:
See example at <URL:http://www.cc.jyu.fi/~mira/moz/formtest.php>. The problem is that the label of submit button is always centered on the button regardsless of 'text-align' property in CSS....
4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
3
by: Chris S | last post by:
I've been unsuccessfully attempting to write a method in Javascript to change an input field from TEXT to SELECT when a user selects (or unselects) a radio button. In my frustration I have been...
2
by: Dave Almighty | last post by:
I've spent the last couple of hours looking desperately through every corner of the internet for a solution to the following question (and my teeth have been ground down almost to nothing). With a...
5
by: omar999 | last post by:
I have a CMS which displays some flight routes, alongside prices, dates which is using asp and sql server 05. works well - i.e an update on the CMS page populates the sql table and then the asp...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.