View Full Version : Issues with Forms on a layout

12-08-2005, 07:16 AM

Im have a question regarding forms, the ruddy things always leave a blank row after/below them which after spending a while coming up with a nice layout, now goes about its ways and destroys the look of it.

Im not sure if this is just how things are, and theres no way of getting around it, but i thought rather than pretty much rip up the original site design find out if there something i can do to correct the problem.

Effectively if i create a table with a cell that is w200 x h20 and then put a form inside it with or without a textbox, the space it now occupies exceeds the 20 pixel height which ive specified for it. Its about 45pxls tall instead of the 20 I need it to be. Theres always a blank row which isnt asked for, and certainly isnt wanted, but there it sits ruining what im trying to create.

screenshot example:

Below is my code creating the 3rd table seen in the example:

<form id="form1" name="form1" method="post" action="">
<div align="center">
*<input name="textfield" type="text" size="15" />

Is there any getting around these problems?? Either a better/correct way of doing the form and its components, or something else i can use to get around the issue of this stretching parts of my site.
I originally thought about putting the forms onto layers, ive not used them much but occasionally in the past when needed, however the layout is centered to the page, and i dont know if its possible to lock a layer to a fixed point centrally rather than 0,0 being the top left, i'd need 0,0 being the top center (using negative values to go left of center etc)

Please help me, the last thing i need now is to realise i need a whole new re-design.

Many thanks in advance,

12-08-2005, 07:20 AM
<form id="form1" name="form1" method="post" action="" style="margin:0;padding:0;text-align:center">
*<input name="textfield" type="text" size="15" />
align="center" is deprecated and shouldn't be used. CSS should be used in its place. Your main problem was a form has a default margin.

12-08-2005, 05:27 PM
hmmm, so its Dreamweavers way of going about it which has been messing me about, guess it serves me right for being lazy!

Thanks heaps for that Aero!