我正在寻找一种在 CSS 中将文本输入的高度设置为正常高度的百分比的方法,如果没有声明高度,它将自然地给定 font-family/font-sizes。我不是在寻找它所在容器高度的百分比。就像这样:
CSS:
#container {
height: 100%;
width: 100%;
}
input {
width: 100%;
background: orange;
height: [I want this 150% of the height normally assigned to the element]
font-family: inherit;
font-size: inherit;
}
#results {
width: 100%;
background: pink;
height: auto;
height: 100%;
}
HTML:
<div id="container">
<input type="text">
<div id="results"></div>
</div>