【问题标题】:Bootstrap/CSS div placement issueBootstrap/CSS div 放置问题
【发布时间】:2023-04-09 07:24:02
【问题描述】:

在 Twitter Bootstrap 脚手架页面的 .well 中放置几个​​ div 时遇到了一点麻烦。我一直在研究它,但我的 CSS 知识有限,我主要是自学。

http://jsfiddle.net/hEvwR/

它应该是这样的:

这最初是在 Jade 中,但我将它转换为问题。我也很喜欢此页面上有关最佳做法的任何建议。

【问题讨论】:

    标签: html css twitter-bootstrap


    【解决方案1】:

    http://jsfiddle.net/hEvwR/2/

    改变

        <div class="span5">
          <p><strong>Enter Your Mobile Phone Number</strong>
          </p>
          <input id="features-demo-number" type="text" placeholder="555-123-4567" style="text-align:center;padding:10px 12px;font-size:16px;margin-top:10px;" class="input-medium"/>
          <div class="pull-left">
            <p><strong>(Optional) Enter a MLS identification number for a more personalized demo</strong>
            </p>
            <input id="features-demo-mls-number" type="text" placeholder="123456789" style="text-align:center;padding:10px 12px;font-size:16px;margin-top:10px;" class="input-medium"/><br/>
            <button id="features-demo-customer" class="btn btn-primary btn-large">Send <strong>Buyer</strong> Notification <i class="icon-share-alt icon-white"></i>
            </button>
          </div>
          <div class="pull-right">
            <video id="video-preview" controls="controls" preload="auto" poster="images/poster.png" width="250" height="140" data-setup="{}" class="video-js vjs-default-skin">
              <source src="https://s3.amazonaws.com/textoad.com/assets/textoad.mp4" type="video/mp4">
              </source>
            </video><a href="/signup" style="margin-top:20px;margin-left:0px;font-size:18px;padding-left:20px;padding-right:20px;text-align:center;" class="btn btn-large btn-primary">Sign Up Now</a>
          </div>
        </div>
    

        <div class="span5">
          <div class="pull-left">
            <p><strong>Enter Your Mobile Phone Number</strong></p>
            <input id="features-demo-number" type="text" placeholder="555-123-4567" style="text-align:center;padding:10px 12px;font-size:16px;margin-top:10px;" class="input-medium"/>
            <p><strong>(Optional) Enter a MLS identification number for a more personalized demo</strong>
            </p>
            <input id="features-demo-mls-number" type="text" placeholder="123456789" style="text-align:center;padding:10px 12px;font-size:16px;margin-top:10px;" class="input-medium"/><br/>
            <button id="features-demo-customer" class="btn btn-primary btn-large">Send <strong>Buyer</strong> Notification <i class="icon-share-alt icon-white"></i>
            </button>
          </div>
          <div class="pull-right">
            <video id="video-preview" controls="controls" preload="auto" poster="images/poster.png" height="140" data-setup="{}" class="video-js vjs-default-skin">
              <source src="https://s3.amazonaws.com/textoad.com/assets/textoad.mp4" type="video/mp4">
              </source>
            </video><a href="/signup" style="margin-top:20px;margin-left:0px;font-size:18px;padding-left:20px;padding-right:20px;text-align:center;" class="btn btn-large btn-primary">Sign Up Now</a>
          </div>
        </div>
    

    并添加

    .span5{width:auto;}
    #video-preview{width:210px!important;}
    .span5>.pull-left{width:210px}
    

    【讨论】:

    • 酷,它开始适合了。我不知道 '!important' 命令,这似乎可以解决问题。谢谢!
    • @Alex 仅用于教育目的:!important 确实是一条规则,而不是命令:developer.mozilla.org/en-US/docs/CSS/…
    猜你喜欢
    • 2010-10-22
    • 2017-03-19
    • 1970-01-01
    • 1970-01-01
    • 2016-01-02
    • 2021-08-20
    • 2021-10-02
    • 2018-02-04
    • 2014-09-26
    相关资源
    最近更新 更多