Height of an element is relative to its parent. Thus, if you want to make expand your element into the whole height of the viewport, you need to apply your CSS to html
and body
as well (the parent elements):
html, body {
height: 100%;
}
#textbox {
width: 100%;
height: 100%;
}
Alternative solution with CSS3: If you can use CSS3, you can use Viewport percentage units and directly scale your textbox to 100 % height (and 100% width) of the viewport (jsfiddle here)
body {
margin: 0;
}
#textbox {
width: 100vw;
height: 100vh;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…