当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Can't understand how the submit button is vertically aligned

问题描述:

When all the controls on this page are lined up, for some reason the submit button (and the first select control) are vertically aligned to the top of the other controls, even though the other controls HAVE a label and the submit DOESN'T...

Also if you resize the page so that the controls are broken over two lines, the submit button align to the top and not to the other controls anymore.

http://test.cdudigital.com/?q=test

Why is this?

网友答案:

Because the vertical-align property is not set on the button, there is no consistent reference from which to position the button. If you set the vertical-align property to "top" and give the button a margin-top of 1 em (this being the presumed size of the labels above the other elements), it will position itself consistently.

<input name="test6" class="form-submit" id="edit-test6" style="vertical-align: top;margin-top:1em;" type="submit" value="Apply">
网友答案:

Apply button doesn't have vertical-align: top property.

分享给朋友:
您可能感兴趣的文章:
随机阅读: