html - 将容器设置为垂直列而不是行

标签 html css twitter-bootstrap

我接到了编辑 friend 网站的任务。我的 HTML/CSS 知识非常有限。

能否请您告诉我如何垂直(按列)而不是按行显示 ffg 代码。

示例是来自编辑器的代码:

 <div class="content-section-a">

    <div class="container">

        <div class="column">
            <div class="col-lg-5 col-sm-6">
                <hr class="section-heading-spacer">
                <div class="clearfix"></div>
                <h2 class="section-heading">Member of the<br>Smartrac Group</h2>
                <p class="lead">Smartrac is a national consulting firm that provides creative and sustainable solutions to challenges facing the modern business</p>
            </div>
           <!-- <div class="col-lg-5 col-lg-offset-2 col-sm-6">
                <img class="img-responsive" src="img/ipad.png" alt="">
            </div>-->
        </div>

    </div>
    <!-- /.container -->

</div>
<!-- /.content-section-a -->

<div class="content-section-b">

    <div class="container">

        <div class="column">
            <div class="col-lg-5 col-lg-offset-1 col-sm-push-6  col-sm-6">
                <hr class="section-heading-spacer">
                <div class="clearfix"></div>
                <h2 class="section-heading">Compliance in terms of :<br>Consumer Protection Act</h2>
                <p class="lead">All suppliers of goods and services will need to take note of the new measures and ensure that they are able to comply with the Act's requirements. Let us help you realise that.</p>
            </div>
             <!--<div class="col-lg-5 col-sm-pull-6  col-sm-6">
                <img class="img-responsive" src="img/dog.png" alt="">
            </div>-->
        </div>

    </div>
    <!-- /.container -->

这显示为横跨文本的一行和客户不再需要的图片的占位符,我已将其注释掉。

我如何只显示文本,但在一行中的列中垂直彼此相邻,而不是单独显示

最佳答案

您只需将两个 block 排成一行并删除 col-lg-offset-1col-sm-push-6 :

<div class="container">

    <div class="row">
        <div class="col-lg-5 col-sm-6">
            <hr class="section-heading-spacer">
            <div class="clearfix"></div>
            <h2 class="section-heading">Member of the<br>Smartrac Group</h2>
            <p class="lead">Smartrac is a national consulting firm that provides creative and sustainable solutions to challenges facing the modern business</p>
        </div>
           <div class="col-lg-5  col-sm-6">
            <hr class="section-heading-spacer">
            <div class="clearfix"></div>
            <h2 class="section-heading">Compliance in terms of :<br>Consumer Protection Act</h2>
            <p class="lead">All suppliers of goods and services will need to take note of the new measures and ensure that they are able to comply with the Act's requirements. Let us help you realise that.</p>
        </div>
    </div>

</div>
<!-- /.container -->

关于html - 将容器设置为垂直列而不是行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30551593/

相关文章:

Jquery 事件 onclick 不起作用

javascript - 旋转木马外的导航控件 - Zurb Foundation Orbit

html - 比图像宽的 href 或位于左侧的图像

html - 两个元素之间有奇怪的额外空间?

css - Bootstrap 小分辨率图像网格

html - Bootstrap 3 上绝对 div 内的 col-sm-* 宽度问题

php - 将多条记录插入php中的不同占位符和网格系统中的错误

html - 居中CSS div,中间有问题

html - 是否溢出 :hidden not work on floats?

javascript - 每 2 个按钮更改为换行符