Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make textarea scale to web page when using twitter-bootstrap

I am trying to make the textarea scale according to page size. I.e I am trying to make the textarea fill the space between the second container and the footer.

HTML:

    <!DOCTYPE html>
    <html>
      <head>
        <title>MySite</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <!-- Bootstrap -->
        <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="sticky-footer.css" rel="stylesheet">
      </head>
  <body>
      <div id="wrap">
        <div class="container">
            <h4 class="well well-sm">My site </h4>
        </div>
        <div class="container">
          <div class="well well-sm">
          <div class="btn-group">
            <button type="button" class="btn btn-default">Domain</button>
            <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
              <span class="caret"></span>
            </button>
            <ul class="dropdown-menu" role="menu">
              <li><a href="#">Test</a></li>
              <li><a href="#">Test 2</a></li>
            </ul>
          </div>
          <div class="checkbox inline">
            <label>
              <input type="checkbox" id="checkBoxError">Error</input>
            </label>
          </div>   
          </div> 
        </div>
        <div class="container">
          <textarea disabled></textarea>
        </div>
    </div>
      <div id="footer">
      <div class="container">
        <p class="well well-sm">footer</p>
      </div>
    </div>
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
  </body>
</html>

CSS (sticky-footer.css):

/* Sticky footer styles
-------------------------------------------------- */

html,
body {
  height: 100%;
  /* The html and body elements cannot have any padding or margin. */
}

/* Wrapper for page content to push down footer */
#wrap {
  min-height: 100%;
  height: auto !important;
  height: 100%;
  /* Negative indent footer by its height */
  margin: 0 auto -60px;
  /* Pad bottom by footer height */
  padding: 0 0 60px;
}

/* Set the fixed height of the footer here */
#footer {
  height: 60px;
  /*background-color: #f5f5f5;*/
}

#mytextbox {
    min-height: 100%;
    height: auto !important;
    width: 100%;
    height: 100%;
}

What should I do to make the textarea fill the space (scale to the page)?

Thanks.

like image 489
DarkRoast Avatar asked Sep 10 '13 18:09

DarkRoast


1 Answers

give textarea width as 100%,

<textarea disabled style="width:100%" ></textarea>

see the fiddle

like image 68
Able Alias Avatar answered Oct 16 '22 07:10

Able Alias