How to "Autosize" a <textarea>?

Discussion in 'CSS' started by Zourz, Mar 27, 2007.

  1. #1
    Hello world :)

    I have a problem with <textarea>.

    I have several pictures placed to the right in a <div>.
    To the left of this div, I want to have a <textarea> that fills the
    remaining space.
    All this lays within a main-div.

    (I have no static width/height of the main-div)

    <!-- Main panel -->
    <div style="border:1px solid #000000;">
     <textarea style="float:left; height:100%;"></textarea>
    
     <!-- Image panel -->
     <div style="float:right;">
      <img src="pic1.jpg"><br>
      <img src="pic2.jpg">
     </div>
    
     <!-- Make border of main panel expand downwards -->
     <div style="clear:both;"></div>
    </div>
    HTML:
    Maybe anyone can help me out?

    Kind Regards
     
    Zourz, Mar 27, 2007 IP
  2. Josh Inno

    Josh Inno Guest

    Messages:
    1,623
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Ah, a simple fix if it was just text would be to put the picture first, then float the text up around it, rather than visa versa. I'm not sure how well it would work with a text area though.

    But if a text area takes up all the available space alloted to it the way that a text field does, that may work.
     
    Josh Inno, Mar 27, 2007 IP
  3. Zourz

    Zourz Member

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Hi Josh.
    Thank you for your reply.
    I do not succeed with a textarea. :/

    Is this really impossible?
    Anyone who knows how to accomplish this?

    Greetings
     
    Zourz, Apr 11, 2007 IP
  4. Josh Inno

    Josh Inno Guest

    Messages:
    1,623
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This is the biggest problem with divs and floats that I have found, the problem with doing an auto-width on a structure that you want to float up next to an image. I've only found a solution for text. If I happen across one for text-area, I'll be sure to let you know.
     
    Josh Inno, Apr 11, 2007 IP
  5. Zourz

    Zourz Member

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    Thanks in advance! :)
     
    Zourz, Apr 11, 2007 IP