aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Vertically Align Two Input Tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Vertically Align Two Input Tags" Watch "Vertically Align Two Input Tags" New topic
Author

Vertically Align Two Input Tags

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1413
I cannot figure out how to get these two input boxes aligned vertically. The following does not work.




Neither does this:



Please help.
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3051
    
  36

I assume that you want to vertically center your captions ("User ID", "Password") and text boxes. In the simplest way, have a fixed height for your input fields, and use that same height as line-height CSS property for your captions.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1413
Devaka Cooray wrote:I assume that you want to vertically center your captions ("User ID", "Password") and text boxes. In the simplest way, have a fixed height for your input fields, and use that same height as line-height CSS property for your captions.


How will the line-height affect the vertical alignment? Wont this change the horizontal spacing between the text boxes?

Maybe I am asking the question in the wrong manor. What I desire is that the left edges of the two inpt tags align on the page with the same x axis coordinante.
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3051
    
  36

Maybe I am misinterpreting what you are trying to say, but to make it sure, do you understand that 'horizontal' means X (left-right) axis, and 'vertical' means Y (top-bottom) axis? If lining up the left margins is what you were asking, it is all about horizontal alignment - not vertical. To get that done, you can have a same fixed width assigned to all your captions in the simplest way.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Vertically Align Two Input Tags