Click here to Skip to main content
15,896,497 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a HTML file which contains 2 forms, which are the same at the moment. All I want is for my web page to be split into 2 halves, and each form goes to one side. So each form should have their own half of the screen, and they should be aligned vertically and horizontally in that half.

It's just not working out.

I currently have this: http://www.datafilehost.com/d/a18afce1[^]
(don't use their download manager). There are no executable files in there (is HTML executable?)
because i've been moaned at before for having executables in my attachments...


-Rixterz
Posted

It is not a good practice to have multiple forms on a single HTML, however if you decided that this what you want, than use css columns to put them side-by-side...
https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_multi-column_layouts[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 5-May-14 7:43am    
Sure, a 5.
—SA
Kornfeld Eliyahu Peter 5-May-14 7:44am    
Thank you...
Sanket Saxena 5-May-14 9:05am    
correct +5
Kornfeld Eliyahu Peter 5-May-14 9:19am    
Thank you...
I had been having a lot of trouble with alignment across various browsers and local vs. thin-client rendering. I solved it by taking full charge of the locations of all objects and their sized.

Use the <form style='position:absolute;top:##px;left:##px;width:??px;'>> to force the location of the upper left corners of your <form> (div/table/etc.).

## is some numerical value. To align the forms side-by-side, set the tops the same, etc.

Why the ?? with width? I found another problem was declaring the width. Although using a % for the width would be very handy, I've found it at times unreliable. I suggest you define the width, as well, in px.

If they need to be the same height, then add height:##px

So - now you put all of this into a style sheet, which you can use on both forms, EXCEPT, the values you need to move the forms so they don't overlap one another (e.g., left:10px; vs. left:510px;).

There are other ways to do this (based upon position:relative, for example. The above allows the least flexibility in location. In my case, it's exactly what I wanted.

I'm a bit confuse on how you can have two forms aligned both vertically and horizontally in their respective halves. That description implies they overlap.

 
Share this answer
 
v2
Comments
W Balboos, GHB 5-May-14 9:51am    
I don't mind a down-vote: just explain why!
[no name] 5-May-14 12:53pm    
good answer, but imagine the html being split in 2 vertically. one form is centred in its half so its in the centre of that half | ¦1¦ | ¦2¦ |
W Balboos, GHB 5-May-14 14:29pm    
Thanks for the 'good answer' words - I was dismayed that the answer was down-voted when it would, indeed, work. Not the best solution, perhaps, but the one-star has the implication of it being a bad answer. Thus my need to know why it was given a negative response.

In case you (and/or other readers) are not aware of the scoring system, 3* is neutral around here.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900