V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
fourstring

求教关于 bootstrap 的几个问题

  •  
  •   fourstring · Jan 20, 2017 · 2233 views
    This topic created in 3393 days ago, the information mentioned may be changed or developed.
    <div class="row">
        <div class="col-lg-12">
          <form>
            <div class="form-group">
              <label for="searchResult">查询结果</label>
              <textarea class="form-control" id="searchResult"></textarea>
            </div>
          </form>
        </div>
    </div>
    

    现在我想调节 textarea 的大小(默认效果如下图),如果直接更改width属性,就不能支持响应式,如果用默认值 100%,就会占满整个屏幕,有没有别的设计方法? 第二个问题,给contanier加上center-block类时,只能达到左右居中的效果。如果想上下居中,该如何处理?

    感谢赐教!

    7 replies    2017-01-21 19:24:04 +08:00
    fourstring
        2
    fourstring  
    OP
       Jan 20, 2017
    @xiaopc 谢谢!
    fourstring
        3
    fourstring  
    OP
       Jan 20, 2017
    @xiaopc 您指的是这一部分吗? http://v3.bootcss.com/css/#grid
    我似乎没有找到我想要的内容……还请您赐教
    xiaopc
        4
    xiaopc  
       Jan 21, 2017 via Android
    @fourstring 啊 sorry 就是栅格这,好久没看忘了😅
    fourstring
        5
    fourstring  
    OP
       Jan 21, 2017
    @xiaopc 似乎可以给文本框设置 width:200%,但是这样只能达到两倍宽度。用 height:200%没有效果。应该是 row 的高度限制了 textarea 的高度。有什么办法调整 row 的高度吗?
    xiaopc
        6
    xiaopc  
       Jan 21, 2017   ❤️ 1
    @fourstring textarea 外层的 form-group 没有具体的高度,对内部的 textarea 元素加百分比是没用的
    fourstring
        7
    fourstring  
    OP
       Jan 21, 2017
    @xiaopc 我用 id 选择器生效了,应该是 row 类里设置了高度,然后层叠结果是 row 中的生效。用 id 选择器特殊性高,所以层叠取胜
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6324 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 02:39 · PVG 10:39 · LAX 19:39 · JFK 22:39
    ♥ Do have faith in what you're doing.