html - 使用 twitter-bootstrap 时使文本区域缩放到网页

标签 html css twitter-bootstrap

我正在尝试使文本区域根据页面大小进行缩放。即我试图让文本区域填充第二个容器和页脚之间的空间。

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%;
}

我应该怎么做才能使 textarea 填充空间(缩放到页面)?

谢谢。

最佳答案

将文本区域宽度设置为 100%,

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

参见 fiddle

关于html - 使用 twitter-bootstrap 时使文本区域缩放到网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18726114/

相关文章:

javascript - 如何防止 CSS 干扰注入(inject)的 HTML 片段?

jquery - 如何使设定的文本大小填充容器

javascript - 使随机图像出现在 Bootstrap 主题中的代码编辑器

html - LESS 编译的 css 中动态属性的最佳方法

jquery - 使用 bootstrap 和颜色选择器更改 div 中选定文本的颜色

javascript - 如何从外部关闭非模态覆盖对话框

javascript - Jquery如果$this属性选择器包含一个词

javascript - 根据下拉列表的选择提交来自不同字段的数据 - laravel

html - 使当图像通过 css 变大时,它会在所有内容的前面进行

html - 让z-index > 0的<div>在零层占用0空间