我想将下图中的按钮对齐到底部,我尝试了很多技巧,但没有任何东西似乎没有打破它的工作。该按钮将占用一个固定的空间,而textarea将填充剩余的空间。增加了codepen示例!对齐按钮到底部(浮动)
想非flexbox答案(ie9 +)!如果不是香草css,也只能作为预处理器使用。
HTML:
<div class="wrapper">
<div class="text">
<div class="right">
<button>submit</button>
</div>
<div class="left">
<textarea></textarea>
</div>
</div>
</div>
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
CSS:
body, html {
margin: 0;
}
.wrapper {
position: fixed;
bottom: 0;
width: 100%;
background: green;
}
.text {
width: 800px;
margin: 0 auto;
background: red;
}
.right {
float: right;
padding-left: 10px;
height: 100%;
background: gray;
}
textarea {
width: 100%;
height: 200px;
box-sizing: border-box;
}
.left {
overflow: auto;
padding: 10px;
}
JS:
tinymce.init({
selector: 'textarea',
theme: 'modern',
width: '100%',
height: 50,
autoresize_min_height: 50,
menubar: false, // removes top menubar,
statusbar: false, // removes bottom statusbar
toolbar: 'undo redo | bold italic | link image',
plugins: ['image autoresize'],
automatic_uploads: false,
});
http://codepen.io/basickarl/pen/Megjyb
Doh!忘了提及没有Flexbox(ie9 +,该死的我一直忘记提及这一点)正在使用,我会1+你的努力,它可能会帮助一些其他可怜的灵魂:) –