Input text fields

Post all HTML related questions here. No support.

Moderator: Project members

Locked
Message
Author
KristianB
500 Command not understood
Posts: 2
Joined: 2015-03-15 08:16
First name: Kristian
Last name: Beronis

Input text fields

#1 Post by KristianB » 2015-03-15 08:37

I am new to html. This is a very simple question. I am dealing with forms. I want all the input text fields to start at the same x-axis point regardless of the size of the label. I want the labels to be left aligned and all the text fields to start at the same x-axis point.I don't want to use tables or "&nbsp". Is there a simple solution or Should I use separate divisions for labels and input fields? I don't mind using css but I prefer it to be simple.

<form>
<input type="text" name="n1"><br>
<label>Phone No.</label>
<input type="text" name="p1">
</form>

I want "n1" and "p1" to start at the same x-axis point.
<URL removed, not allowed.>

User avatar
audiopro
226 Transfer OK
Posts: 295
Joined: 2013-03-23 12:55
First name: Keith
Location: Morecambe, England

Re: Input text fields

#2 Post by audiopro » 2015-03-15 09:02

This is one situation where tables would be the easiest way as the data is in a tabular form.
Morecambe - Where the sun goes at night

User avatar
botg
Site Admin
Posts: 35539
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Input text fields

#3 Post by botg » 2015-03-15 15:13

You should use XHTML, easier to parse and easier to write.

KristianB
500 Command not understood
Posts: 2
Joined: 2015-03-15 08:16
First name: Kristian
Last name: Beronis

Re: Input text fields

#4 Post by KristianB » 2015-03-16 21:25

Thanks a lot both of you!
<URL removed, not allowed.>

Locked