tags:

views:

26

answers:

1

Below is an exceedingly simple HTML page.

1) I would like to add a menu across the top, which means that the position of that edit box may have to change(?) or must it? Is the text box positioned relative to its enclosing div (which will follw the menu's div)?

2) I want to add more form elements, and position them precisely, with coords relative to the start of the form, just after the menu (I am generating the HTML programatically, if it helps to know that; for instance, I can add a fudge factor).

3) and after the last of those I want a submit button, which is always guaranteed to be at the bottom of the page, no matter how many input elements I add in the middle (so, perhaps wrap the form's controls in a div?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"&gt;
<html>
<head>
</head>
<body>
<form action="HTTP://localhost/b/submitted.php" method="post">

<div class="TEdit" id="TextEditBox1" style="position: absolute; top:56px; left: 72px; width: 121px; height: 21px;">
  <input type="text" name="TextEditBox1">
</div>

<div class"submit_button" style="position:absolute; top:102px; left:132px;"><input type="submit" name="submitButton" value="Submit"></div>
</form>
</body>
</html>
+1  A: 

For the most part, if you just put the page elements in the code in the order you wish to see them, flow of the page will lay them out as you've described.

For pixel perfect positioning, you can use absolute positioning as you have in there, but that's not that "best" way to do it.

I think the best thing for you to do would be to read up on CSS positioning over at w3schools if you want a good understanding of how to layout page elements.

idrumgood
Sorry, I can't let the browser decide. The HTML is generated by a windows based program and I need WYSIWYG - the browser must mirror exactly the form designed in the windows program, but with a menu across the top.
Mawg
Sure, I'll read up on it (again - just can';t seem to get my head around it :-) I just thought that there would be an off the shelf solution for something so simple. +1 for taking the time to reply. Hmmm, could you rework the example to make it work? It would get you the question.
Mawg