Make textarea as big as screen

Hi, I have a textarea:


and, I would like to make it as big as the screen. The white part is where the textarea ends. I would like to fit it to the whole screen. The project URL is https://p2pbin.glitch.me

<style>
textarea{
   width: 100%;
   height: 100%;
}
</style>
1 Like

Lol thanks.

lol that was super easy;

but you can use this if you want this for divs and stuff like that:

<style>
textarea {
width: 100%;
height: 100vh;
}
</style>
2 Likes

Why doesn’t height: 100% work?
I’m going to go update my 200% height canvas right now…

@CarlyRaeJepsenStan

you need to use height:100vh; <–

yeah, I know - why doesn’t height: 100% work? is there a built-in height margin or something?
nvmd, i found this: https://stackoverflow.com/questions/21357238/css-height-100-percent-not-working

100℅ doesn’t always mean 100% of the viewport. The percentage value always depends on the parent container. So it’s safe to use vh (viewport height) and vw (viewport width) values instead.

2 Likes

Textareas can be resized, by the way.

I know that, but I’m not trying to have people resize textareas on their phones.

You can set resize: false in the CSS values to avoid that.

1 Like

Mhm, if I didn’t use it, the app would be broken lol