开发者

CSS: Position a Submit button after the last control on a form

开发者 https://www.devze.com 2023-01-05 01:21 出处:网络
I programatically generate an HTML form and position the controls on it like so: <div class=\"TComboBox\" id=\"ComboBox1\" style=\"position: fixed; top:16px; left: 16px; wid开发者_如何学JAVAth: 14

I programatically generate an HTML form and position the controls on it like so:

<div class="TComboBox" id="ComboBox1" style="position: fixed; top:16px; left: 16px; wid开发者_如何学JAVAth: 145px; height: 21px;">

Hopefully that is acceptable? The form is generated in a program, on a grid, and I want it to be WYSIWYG, so I am using the same coordinates on the HTML (or trying to, using CSS).

My problem is how to specify the position of the Submit button, which I also add programatically to the HTML. I know the Top/Left of each component on the form, so that means that I know the Top/Left of the the bottom-most component. I want to position the Submit button, say, 25 pixels below that and in the center of the page.

How should my HTMl look with inline CSS? (I don't have a separate CSS file)


<input type="submit" value="Go" style="position:relative; top:25px; left: 50%;">
0

精彩评论

暂无评论...
验证码 换一张
取 消