如何排列<按钮>所以它在textarea之后不会中断?按钮>
假设我有一个包含姓名、电子邮件和消息的表单。然而,我的“发送消息”按钮损坏了,并且在文本区域之后没有对齐,而是在文本区域和最后一个输入之间对齐!我做错了什么?
我的 HTML 表单片段是:
<form class="form-contact">
<div class="labels">
<label for="name">Name:</label><input name="name" type="text" />
<label>Email:</label><input name="name" type="text" />
<label>Message:</label><textarea name="name" type="text"></textarea>
<button>send</button>
</div>
</form>
我的 CSS 是:
.form-contact {
width:100%;
margin:auto;
}
label {
text-align:right;
width:300px;
float:left;
font-size:24px;
margin-top:27px; }
.labels {
margin-top:36px;
float:
}
form {
display:inline;
margin:0;
}
input {
float:left;
margin-top:28px;
margin-left:27px;
height:23px;
line-height:23px;
font-size:23px;
color:#01a4c0;
width:309px;
}
textarea {
float:left;
margin-top:28px;
margin-left:27px;
height:23px;
line-height:23px;
font-size:23px;
color:#01a4c0;
width:309px;
height:134px;
}
button {
width:88px;
height:29px;
border:none;
background:#01a4c0;
color:#FFF;
font-size:22px;
text-align:center;
float:left;
cursor:pointer;
margin-top:13px;
display: block;
}
So Let's say I have a form with Name, Email and Message. However my "send message" button is breaking and not aligning AFTER the textarea but between the textarea and the last input! What I am doing wrong?
My HTML form snippet would be:
<form class="form-contact">
<div class="labels">
<label for="name">Name:</label><input name="name" type="text" />
<label>Email:</label><input name="name" type="text" />
<label>Message:</label><textarea name="name" type="text"></textarea>
<button>send</button>
</div>
</form>
And my CSS would be:
.form-contact {
width:100%;
margin:auto;
}
label {
text-align:right;
width:300px;
float:left;
font-size:24px;
margin-top:27px; }
.labels {
margin-top:36px;
float:
}
form {
display:inline;
margin:0;
}
input {
float:left;
margin-top:28px;
margin-left:27px;
height:23px;
line-height:23px;
font-size:23px;
color:#01a4c0;
width:309px;
}
textarea {
float:left;
margin-top:28px;
margin-left:27px;
height:23px;
line-height:23px;
font-size:23px;
color:#01a4c0;
width:309px;
height:134px;
}
button {
width:88px;
height:29px;
border:none;
background:#01a4c0;
color:#FFF;
font-size:22px;
text-align:center;
float:left;
cursor:pointer;
margin-top:13px;
display: block;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
clear:both;
查看 http://jsfiddle.net/yzK2k/
Use
clear:both;
Check it out at http://jsfiddle.net/yzK2k/