本文介绍了使用twitter-bootstrap时,使textarea缩放到网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我想根据页面大小制作textarea缩放。我尝试让textarea填充第二个容器和页脚之间的空间。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):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填充空间)?What should I do to make the textarea fill the space (scale to the page)?谢谢。推荐答案 ,<textarea disabled style="width:100%" ></textarea>请参阅 fiddlesee the fiddle 这篇关于使用twitter-bootstrap时,使textarea缩放到网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-30 09:20