discuss icon indicating copy to clipboard operation
discuss copied to clipboard

Text area full width works but full height doesn't

Open Sparkenstein opened this issue 4 years ago • 1 comments

not sure if this is a bug in tailwind or I am doing something wrong. probably it's just me because I can't see any such previous issue anywhere. I am trying to create a pastebin ui for practice. this is my html:

  <body class="h-screen w-screen bg-gray-800">
    <div class="">
      <textarea class="rounded-lg resize-none w-full h-full"></textarea>
    </div>
  </body>

Here my text area is getting full width but not full height. What am I missing? I tried another approach with flexbox too, which was not working for me at all. What is the better way to do this?

Sparkenstein avatar Feb 02 '20 10:02 Sparkenstein

Height of an element is relative to its parent. Thus, if you want to make expand your element into the whole height, you need to apply your CSS to div as well.

  <body class="h-screen w-screen bg-gray-800">
    <div class="h-full">
      <textarea class="rounded-lg resize-none w-full h-full"></textarea>
    </div>
  </body>

cytRasch avatar Feb 04 '20 09:02 cytRasch