您可以使用在textarea
「粘性軀」的方法,以在底部始終保持,而不管內容的大小。本品採用陰性切緣上的內容包裝:
body {
background: #fafafa;
}
.mdl-grid {
padding: 0!important;
margin-bottom: -25px !important;
}
.messages {
position: relative;
}
.mdl-cell {
overflow-x: hidden;
overflow: auto;
min-height:93vh;
background: #bdbdbd;
padding: 0!important;
text-align: center;
color: #424242;
font-weight: bold;
}
textarea {
position: absolute;
bottom: 0;
left: 0;
width: 98%;
height: 25px;
}
<html>
<head>
<!-- Material Design Lite -->
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.0/material.min.js"></script>
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.0/material.indigo-pink.min.css">
<!-- Material Design icon font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>
<div class="mdl-grid">
<div class="messages mdl-cell mdl-cell--4-col">4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<br>4<
<textarea></textarea>
</div>
<div class="mdl-cell mdl-cell--8-col">8</div>
</div>
</body>
</html>