我在设计联系表格时遇到了一个小问题。我希望消息字段和提交按钮位于所有其他输入字段的右侧,沿顶部对齐。当我使用clear:both
andfloat:right
时,消息和提交按钮会移动,但是它们远低于所有其他字段。我该如何解决?
.contact_name {
font-family: fanwood-webfont;
margin-left: 60px;
padding-bottom: 10px;
}
.contact_email {
font-family: fanwood-webfont;
margin-left: 60px;
padding-bottom: 10px;
}
.contact_subject {
font-family: fanwood-webfont;
margin-left: 60px;
}
.contact_message {
clear: both;
float: right;
font-family: fanwood-webfont;
}
.contact_button {
clear: both;
float: right;
}
&
<p class=contact_name>Name (required)<br />
[text* your-name]</p>
<p class=contact_email>Email (required)<br />
[email* your-email]</p>
<p class=contact_subject>Subject<br />
[text* your-subject]</p>
<p class=contact_message>Message<br />
[textarea* your-message]</p>
<p>[submit class:contact_button "Send"]</p>