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

textbox alignment problem

Hi,

I am hoping if there is a kludge in IE6 to make the textbox align with
the top label. It aligns perfectly fine in Opera and in
Netscape/Firefox to some extent.

Thanks.

<style>
.top-label {
background-color:blue;
color:white;
width:100%;
font-weight:bold;
text-align:center;
}

.field {
float:left;
margin-left:5px;
padding:0px;
}
</style>

<div class="field" style="width:75px;">
<div class="top-label">From Date</div>
<input name="FromDate" type="text" style="width:100%;">
</div>

Nov 28 '06 #1
4 7985
Scripsit aa**********@gmail.com:
I am hoping if there is a kludge in IE6 to make the textbox align with
the top label.
Do you want a kludge, or do you want a solution? And what is the problem?
"Aligning with" something isn't a very exact description.
<style>
You should post a URL, not snippets of code, and you should use valid
markup.
<div class="field" style="width:75px;">
<div class="top-label">From Date</div>
<input name="FromDate" type="text" style="width:100%;">
</div>
You should start from constructing logical, semantic markup. And valid
markup - you're even missing a closing </divtag here.

To associate a text with a field, use <labelmarkup.

Do not set widths in pixels - for all that you can know, 75 pixels might not
be enough even for the word "From".

Always set a width for an <inputbox in HTML. You don't want to accept
unknown browser defaults in situations where your CSS code gets ignored. So
use size="...", in addition to any eventual width setting in CSS.

If the input field is for what its name and label suggest, it's width should
be set to something that reflects the length of expected input. I hope your
form explains somewhere what the expected date format is. Generally, setting
size="..." in <inputwithout CSS settings is suitable for data that is
expected to be of fixed length, since HTML has a _more logical_ approach
here (allowing the width to be set in characters).

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

Nov 29 '06 #2
Jukka,

here is the link:
http://ca.geocities.com/aamirghanchi/test.htm

and here are the answers to your questions
-I asked for a kludge, because I know there is no solution as it is IE6
specific problem.
-You will understand what I mean by alignment once you lookup the link.
-If you carefully look at the code snippet I previously posted, I am
not missing any </divtag.
-I did use the LABEL tag in the actual code. Just so that I could
emphasize that this is about frmatting and not about content
description, I have used div tags for labelling.
-This code is targetted for an intranet app therefore I am aware of the
user screen settings as well as the browser (hence IE6). I have
checked the pixel width and the text fits very well in it for all
commonly used screen resolutions and IE6 view>textsize menu selection

Thanks for your good advice and I tend to stick to them when coding for
the general web.

Jukka K. Korpela wrote:
Scripsit aa**********@gmail.com:
I am hoping if there is a kludge in IE6 to make the textbox align with
the top label.

Do you want a kludge, or do you want a solution? And what is the problem?
"Aligning with" something isn't a very exact description.
<style>

You should post a URL, not snippets of code, and you should use valid
markup.
<div class="field" style="width:75px;">
<div class="top-label">From Date</div>
<input name="FromDate" type="text" style="width:100%;">
</div>

You should start from constructing logical, semantic markup. And valid
markup - you're even missing a closing </divtag here.

To associate a text with a field, use <labelmarkup.

Do not set widths in pixels - for all that you can know, 75 pixels might not
be enough even for the word "From".

Always set a width for an <inputbox in HTML. You don't want to accept
unknown browser defaults in situations where your CSS code gets ignored. So
use size="...", in addition to any eventual width setting in CSS.

If the input field is for what its name and label suggest, it's width should
be set to something that reflects the length of expected input. I hope your
form explains somewhere what the expected date format is. Generally, setting
size="..." in <inputwithout CSS settings is suitable for data that is
expected to be of fixed length, since HTML has a _more logical_ approach
here (allowing the width to be set in characters).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Nov 29 '06 #3
Scripsit aa**********@gmail.com:
Jukka,

here is the link:
Please learn how to post to Usenet. See
http://www.cs.tut.fi/~jkorpela/usenet/dont.html

When you have wasted time by not telling the real problem and the real URL
at the start and by upside-down fullquoting, your odds of getting free help
have greatly been reduced.
-This code is targetted for an intranet app
So it was off-topic in any comp.infosystems.www group anyway.

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

Dec 3 '06 #4
Jukka, thanks for your help ... whatever it was.

I was able to fix the alignment problem by setting left margin and
width of the label tag as follows:
<label class="top-label" for="FromDate" style="width:105%;
margin-left:5px;">
>From Date
</label>
So it was off-topic in any comp.infosystems.www group anyway.
This usenet group is listed under stylesheet fora on the w3 site:
http://www.w3.org/Style/CSS/learning#fora
Jukka K. Korpela wrote:
Scripsit aa**********@gmail.com:
Jukka,

here is the link:

Please learn how to post to Usenet. See
http://www.cs.tut.fi/~jkorpela/usenet/dont.html

When you have wasted time by not telling the real problem and the real URL
at the start and by upside-down fullquoting, your odds of getting free help
have greatly been reduced.
-This code is targetted for an intranet app

So it was off-topic in any comp.infosystems.www group anyway.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Dec 4 '06 #5

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

Similar topics

1
by: crowl | last post by:
Hi all, I start developing for pocket pc with C# under VS.NET 2003. I run into trouble with the textbox settings. On the form I have placed a textbox. I noticed that in the textbox properties...
4
by: JIM.H. | last post by:
how do you do Alignment in a textbox?
2
by: Boni | last post by:
Dear all, on my form I have 2 textboxes: Name FilePath Near the textbox FilePath there is a browse button and textbox itself is readonly. So first user presses Browse and selects path, then...
4
by: Nina | last post by:
Hi everyone, I try to a display a .txt file in window's textbox or rich textbox. The text file has contents line by line aligned perfectly when using NotePad to view and print it. But when I...
2
by: Ehsanal | last post by:
plz i have a question: when i put the properties in a textBox like this: TextAlign = System.Windows.Forms.HorizontalAlignment.Right; RightToLeft = RightToLeft.YES; then the writting will...
1
by: jobs | last post by:
I have a content page with a bunch of controls. They are not under a table. I add textboxes and they are won't align left justified like other controls. In Designer they all seem left justified. I...
2
by: gee | last post by:
Hi everyone, I try to a display a .txt file in window's textbox or rich textbox. The text file has contents line by line aligned perfectly when using NotePad to view and print it. But when I...
6
by: rn5a | last post by:
When the EditCommandColumn in a DataGrid is clicked, all the BoundColumns get replaced by TextBoxes so that users can alter the data. By default, the Text in the TextBoxes are left-aligned. Is...
2
by: priyadarshi123 | last post by:
Hi I am Priyadarshi I am facing some problem in alignment of textbox inside <TD>.These are not aligning properly.And when i am making the textbox as multilineand icrease the height of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.