treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] textarea

  • Hello, I wanna ask how to fix the textarea. Cuz on opero shows a different size than the firefox.

  • Please provide some code and throw it up on http://codepen.io or http://jsfiddle.net

  • #message-box {
      width: 484px;
      height: 180px;
      margin-bottom: 15px;
    }
    
    #message-box textarea {
      min-width: 484px;
      max-width: 484px;
      min-height: 40%;
      max-height: 100%;
      font-size: 1.2em;
    }
    
      <div id="message-box">
          <textarea <!-- IF S_UCP_ACTION and not S_PRIVMSGS and not S_EDIT_DRAFT -->name="signature" id="signature" style="height: 9em;"<!-- ELSE -->name="message" id="message"<!-- ENDIF --> rows="15" cols="76" tabindex="4" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" class="inputbox">{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}</textarea>
      </div>
    
  • I don't have Opera installed. Maybe someone else can chime in.

  • Why use a min-width for something like a textarea? I would play it safe and not let the size depend on the contents, but just give it a fixed width/height.

  • Why not just set a width of 100%, especially if it's in a fixed container?

  • I setting 100% cuz the text area can't move him with max-width: 100%. So any sollution?

  • So someone can help me?

  • textarea {
      width:100%;
      height:400px;
      border:1px solid black;
      padding:2px 4px;
      -webkit-box-sizing:border-box;
      -moz-box-sizing:border-box;
      box-sizing:border-box;
    }
  • Thanks, fixed. :)