我想將下圖中的按鈕對齊到底部,我嘗試了很多技巧,但沒有任何東西似乎沒有打破它的工作。該按鈕將佔用一個固定的空間,而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+你的努力,它可能會幫助一些其他可憐的靈魂:) –