Я хочу сделать так, чтобы текстовая область не превышала исходную длину страницы.Это означает, что вам не нужна полоса прокрутки, чтобы увидеть все.
В настоящее время я следую за ответом на этот вопрос, чтобы использовать flexbox, чтобы он динамически заполнял высоту.
В настоящее время текстовая область длиннее исходного размера, поэтому появляется полоса прокрутки, чтобы увидеть все, что нужно прокрутить вниз.
html, body {
height: 100%;
margin: 0;
}
input[type=text]{
width: 100%;
font-size: 32px;
border: 3px solid #999;
padding: 12px 20px;
margin: 5px 10px;
box-sizing: border-box;
flex: 0 1 auto;
outline: none;
}
div {
display: flex;
}
.fillspace {
display: flex;
height: 100%;
}
input[type=text]:focus{
border: 3px solid #555;
}
button {
background-color: #0099cc;
border: none;
color: white;
text-align: center;
padding: 16px 32px;
text-decoration: none;
display: inline-block;
font-size: 32px;
margin: 5px 10px 5px 0;
}
button:hover{
background-color: #007399;
outline: none;
}
button:active{
background-color: #007399;
}
textarea{
outline: none;
resize: none;
font-size: 32px;
border: 3px solid #999;
padding: 12px 20px;
margin: 5px 10px 10px 10px;
box-sizing: border-box;
width: 100%;
height: 100%;
flex: 1 1 auto;
}
textarea:focus{
border: 3px solid #555;
}
h1{
text-align: center;
font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
}
<body>
<h1>Command Queue</h1>
<div>
<input placeholder="Type command here" type="text"/>
<button>Run</button>
</div>
<div class="fillspace">
<textarea id="commandOutput">{{.}}</textarea>
</div>
</body>