我有一些CSS的问题,我有一个内容ID,然后在其中有一个只有填充的类。在填充类中,我有一个文本区域和一个提交按钮。默认情况下,提交按钮在左侧:
但是当我将提交按钮对齐到内容的左侧或右侧时,它会跳到那里,但也会超出内容的范围,就好像它不再属于内容了:
这是我的HTML和CSS代码
HTML:
<div id="content">
<div class="content-padding">
<textarea class="content-post" placeholder="Update your status..."></textarea>
<input type="submit" class="content-submit">
</div>
</div>
CSS:
#content {
width: 60%;
background: #dddddd;
color: #000;
margin: 0 auto;
border-radius: 4px;
margin-bottom: 10px;
height: auto;
}
.content-padding {
padding: 10px;
}
.content-post {
width: 97.5%;
height: 80px;
border: 0px;
background: #fff;
resize: none;
padding: 10px;
outline: none;
margin-bottom: 5px;
border-radius: 4px;
}
.content-submit {
background: #005ddb;
width: 70px;
height: 30px;
border: 0px;
border-radius: 4px;
color: #fff;
outline: none;
cursor: pointer;
float: right;
}
我希望有人能够尽快帮我解决这个问题,感谢!