【问题标题】:statamic / bootstrap problem with vertical align垂直对齐的静态/引导问题
【发布时间】:2019-08-11 08:27:42
【问题描述】:

我是关于 statamic 的新手, 我尝试解决此代码:

<div class="container">
    <div class="intro">
        <div class="row">
            <div class="col-md-12">
                <h2 class="title-uppercase text-white">{{ section_three_title }}</h2>
                <div class="row-project-box row">
                    {{ relate:section_three_categories }}
                    {{ entries }}
                    <div class="col-project-box col-sm-6 col-md-4 col-lg-3">
                        <a href="{{ url }}" class="project-box">
                            <div class="project-box-inner">
                                <h5>{{ title }}</h5>
                            </div>
                        </a>
                    </div>
                    {{ /entries }}
                    {{ /relate:section_three_categories }}
                </div>
                <a href="#" class="h5 link-arrow text-white">view all projects <i class="icon icon-chevron-right"></i></a>
            </div>
        </div>
    </div>
</div>

代码提供了这个:

我想对齐这些框
direzionale operativo dirigenziale 不是水平的,而是垂直的,如下所示:

direzionale
operativo
dirigenziale

我认为这是一个引导配置,但我不了解静态世界 任何人都可以帮助我吗? 非常感谢

【问题讨论】:

    标签: php laravel twitter-bootstrap bootstrap-4 statamic


    【解决方案1】:

    这里的问题似乎是您在列上使用了响应式断点, 因此,如果您想始终将框设置在另一个下方,则必须将.col-project-box 始终设置为全角添加此类col-12 并设置.row-project-box 水平对齐中心将此类justify-content-center 添加到它。

    <div class="container">
    <div class="intro">
        <div class="row">
            <div class="col-md-12">
                <h2 class="title-uppercase text-white">{{ section_three_title }}</h2>
                <div class="row-project-box row justify-content-center">
                    {{ relate:section_three_categories }}
                    {{ entries }}
                    <div class="col-project-box col-12">
                        <a href="{{ url }}" class="project-box">
                            <div class="project-box-inner">
                                <h5>{{ title }}</h5>
                            </div>
                        </a>
                    </div>
                    {{ /entries }}
                    {{ /relate:section_three_categories }}
                </div>
                <a href="#" class="h5 link-arrow text-white">view all projects <i class="icon icon-chevron-right"></i></a>
            </div>
        </div>
    </div>
    

    【讨论】:

    • 太棒了!现在它是垂直的,但盒子真的很大(像整个页面一样大而不是水平)
    • 是的,您必须向.project-box-inner div 添加一些类,例如w-50mx-auto
    猜你喜欢
    • 1970-01-01
    • 2020-09-30
    • 2011-02-26
    • 1970-01-01
    • 2012-08-16
    • 2016-02-28
    • 2015-11-09
    相关资源
    最近更新 更多