【问题标题】:text under bootstrap element引导元素下的文本
【发布时间】:2017-01-19 22:08:12
【问题描述】:

我想将我的引导元素放置在另一个元素下:

这是我的 html 代码:

<!--Home-->
<section id="home" class="home">
    <div class="container">
            <h1 class="quote">Welcome.</h1>


    </div>
</section>

<!--Section 2 : OVer mij-->
<section id="about" class="about section-padding">
    <div class="container">
        <h1 class="home-heading">About</h1>
        <blockquote class="abouttext" class="">
            Welcome to our website. We are offering a custom website just for you!
            We can use bootstrap, HTML, css and javascript for your custom website.
            Just send your design and we will make the website just how you like it!
            Just tell us what you want, or give us a design. We'll make it just how you like.
        </blockquote>
    </div>
</section>
<!--Section 3: services-->
<section id="services" class="contact section-padding">
    <div class="container">
        <h1 class="home-heading">Our sevices</h1>

        <!--images gallery-->
        <br>
        <br>
        <br>
        <br>
        <br>
        <div class="row">
            <div class="col-md-4">
                <div class="thumbnail">
                    <a href="#">
                        <img src="http://placehold.it/350x150">
                        <div class="caption">
                            <p>Website #1</p>
                        </div>
                    </a>
                </div>
            </div>
            <div class="col-md-4">
                <div class="thumbnail">
                    <a href="#">
                        <img src="http://placehold.it/350x150">
                        <div class="caption">
                            <p>Website #3</p>
                        </div>
                    </a>
                </div>
            </div>
            <div class="col-md-4">
                <div class="thumbnail">
                    <a href="#">
                        <img src="http://placehold.it/350x150">
                        <div class="caption">
                            <p>Website #3</p>
                        </div>
                    </a>
                </div>
            </div>
        </div>

    </div>

此代码必须在上图下方:

    <div class="container servicetext">
    <h1>We offer a selected amount of pre-made templates, but we can also make your own personal website.
        We can also upload your site to your webserver if you prefer that.It's all up to you.
    </h1>
    </div>
</section>

这是我的 CSS:

/*Main*/
.section-padding{
    padding-top:100px;
    padding-bottom: 100px;
}
/*home*/
.home {
    height:100vh;
    display:flex;
    justify-content: center;
    align-items: center;
    background-color:#0f1b07 ;
    text-align:center;
    color:white;
}

.home-heading {
    font-size:52px;
}
/*home quote*/
.quote {

    font-size: 50px;
}
/*about*/
.about {

    height:70vh;
    display:flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    text-align:center;
    color:#0f1b07;
}
/*abouttext*/
.abouttext {

}
/*contact*/
.contact {

    display:flex;
    justify-content: center;
    align-items: center;
    background-color: #5c821a;
    text-align:center;
    color:white;

}

我正在使用引导程序 3.3.7。 提前谢谢,希望我的问题很清楚。

【问题讨论】:

    标签: html css twitter-bootstrap positioning


    【解决方案1】:

    每当您想在引导程序中堆叠时,您都必须创建另一行:

    <div class="row">
        <div class="col-md-4">
            <div class="thumbnail">
                <a href="#">
                    <img src="http://placehold.it/350x150">
                    <div class="caption">
                        <p>Website #1</p>
                    </div>
                </a>
            </div>
        </div>
        <!-- more of that -->
    </div>
    <!-- something else -->
    <div class="row">
        <div class="col-md-12">
            <div class="container servicetext">
                <h1>We offer a selected amount of pre-made templates, but we can also make your own personal website.
            We can also upload your site to your webserver if you prefer that.It's all up to you.
                </h1>
            </div>
        </div>
    </div>
    

    【讨论】:

    • 我修好了,我的元素不是我的容器 div,谢谢你的帮助!
    • 你能告诉我如何将元素向下移动一点吗?就像
      标签一样,但我认为使用 20 个 br 标签效率不高...
    • 查看边距和内边距。
    • 是的,我知道这些标签,但我认为这不适用于引导程序...
    • Bootstrap 只是一堆简单的 css,有人为您预先编写。它没有什么特别的不同或神奇之处。
    猜你喜欢
    • 2016-05-03
    • 2014-07-29
    • 2014-04-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多