I'm working on a basic webpage that includes a textarea
element which I want to expand to fill the entire screen, leaving a small gap at the top. Everything looks great in Chrome, but in Firefox, the textarea doesn't stretch all the way to the bottom of the window. Here's the CSS code I've been using:
body#pad textarea {
position: fixed;
top: 3em;
right: 0;
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
background-color: #222;
color: #fff;
display: block;
font-size: 1.2em;
letter-spacing: 0.6px;
padding: 1em 2em 2em;
resize: none;
}
Adding height: 100%
does make the textarea reach full height, but that's not the desired effect since I need some space at the top of the screen. Is there any way using only CSS to solve this issue? I really want to achieve the same look and functionality as in Chrome without relying on JavaScript.