Bootstrap   发布时间:2022-04-18  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了twitter-bootstrap – 如何使用Bootstrap在英雄单元中显示两列?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图让bootstrap的行在英雄单位内部工作.我厌倦了这个例子 How to display a thumbnail in the hero unit with Bootstrap?,但它似乎不起作用.我只在英雄中获得1列.我的猜测是填充导致列换行,因为当将填充设置为0时它似乎正确对齐,但我不确定如何正确地解决这个问题.

<div class="hero-unit" style="padding: 15px;">
    <div class="page-header">
        <h2>
            Example Page Header
            <small>Example Sub Header</small>
        </h2>
    </div>

    <div class="row">
        <div class="span4">
            <img src="http://placehold.it/360x268" alt="">
        </div>

        <div class="span8">
            test
        </div>
    </div>
</div>

解决方法

亚历克斯,

如果您正在使用bootstrap-responsive.css或流体模板,则应用以下标记.

<div class="hero-unit">
    <div class="row-fluid">
        <div class="columnA pull-left">
             <h2>column A</h2>
            <img src="http://placehold.it/500x300.png"/>
        </div>

        <div class="columnB pull-right">
             <h2>column B</h2>
            <img src="http://placehold.it/500x300.png"/>
        </div>

    </div>
  </div>

然后在头部插入以下样式.

.columnA,.columnB{
    width: 500px;

  }

上述代码输出类似于下图的文件

大佬总结

以上是大佬教程为你收集整理的twitter-bootstrap – 如何使用Bootstrap在英雄单元中显示两列?全部内容,希望文章能够帮你解决twitter-bootstrap – 如何使用Bootstrap在英雄单元中显示两列?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。