HTML- Bootstrap : Sidebar pushes main content down

标签 html css twitter-bootstrap

目前我有这个网页: move content up

如图所示,我希望正文紧跟在标题之后,但侧边栏将其向下推。我该如何解决这个问题?

代码是:

<div class="row content-area-main">
            <div class="col-md-4">
              <img src="img/double-lily-modified3.png" alt="LilyPond logo">
            </div>
            <div class="col-md-5 header-info">
              <h1 class="header-info-title">LilyPond</h1>
                <p>... music notation for everyone</p>
            </div>
            <div class="col-md-3">
              <div class="card card-block">
                  <h4 class="card-title">Stable Release</h4>
                  <ul class="list-group list-group-flush">
                    <li class="list-group-item"><a href="#" target="_blank">Download 2.18.2</a></li>
                    <li class="list-group-item"><a href="#" target="_blank">Manuals 2.18.2</a></li>
                  </ul>
              </div>
              <div class="card card-block">
                  <h4 class="card-title">Unstable Release</h4>
                  <ul class="list-group list-group-flush">
                    <li class="list-group-item"><a href="#" target="_blank">Download 2.19.51</a></li>
                    <li class="list-group-item"><a href="#" target="_blank">Manuals 2.19.51</a></li>
                  </ul>
              </div>
              <div class="card card-block">
                  <h4 class="card-title">Pondings</h4>
                  <p>The LilyPond Blog is up and running <a href="http://www.lilypondblog.org/" target="_blank">here</a>! Anyone can follow and leave comments on the blog. To contribute, contact <a href="mailto:ul@openlilylib.org">Urs Liska</a>.</p>
              </div>
            </div>
        </div>
        <div class="row content-area-main">
            <div class="col-md-8">
              <p>LilyPond is a music engraving program, devoted to producing the highest-quality sheet music possible. It brings the aesthetics of traditionally engraved music to computer printouts. LilyPond is free software and part of the GNU Project.</p>
              <p class="header-info-link">Read more in our <a href="#">Introduction</a>!</p>
            </div>
        </div>
        <div class="row content-area">
            <div class="col-md-8">
              <div class="card card-block">
                  <h4 class="card-title">Beatuiful Sheet Music</h4>
                  <img src="img/bwv861-lilypond.png" class="img-fluid img-thumbnail card-image-custom" width="100%">
                  <p class="card-text">LilyPond is a powerful and flexible tool for engraving tasks of all kinds, for example classical music (like the example above by J.S. Bach), complex notation, early music, modern music, tablature, vocal music, lead sheets, educational materials, large orchestral projects, customized output, and even Schenker graphs.</p>
                  <span class="card-link">Browse our gallery of <a href="#">Examples</a> and be inspired!</span>
                </div>
            </div>
        </div>

最佳答案

<div class="row content-area-main">
    <div class="col-md-8">
        <div class="row">
            <div class="col-md-6">
                <img src="img/double-lily-modified3.png" alt="LilyPond logo">
            </div>
            <div class="col-md-6 header-info">
                <h1 class="header-info-title">LilyPond</h1>
                <p>... music notation for everyone</p>
            </div>
        </div>
        <div class="row content-area-main">
            <div class="col-md-12">
              <p>LilyPond is a music engraving program, devoted to producing the highest-quality sheet music possible. It brings the aesthetics of traditionally engraved music to computer printouts. LilyPond is free software and part of the GNU Project.</p>
              <p class="header-info-link">Read more in our <a href="#">Introduction</a>!</p>
            </div>
        </div>
        <div class="row content-area">
            <div class="col-md-12">
              <div class="card card-block">
                  <h4 class="card-title">Beatuiful Sheet Music</h4>
                  <img src="img/bwv861-lilypond.png" class="img-fluid img-thumbnail card-image-custom" width="100%">
                  <p class="card-text">LilyPond is a powerful and flexible tool for engraving tasks of all kinds, for example classical music (like the example above by J.S. Bach), complex notation, early music, modern music, tablature, vocal music, lead sheets, educational materials, large orchestral projects, customized output, and even Schenker graphs.</p>
                  <span class="card-link">Browse our gallery of <a href="#">Examples</a> and be inspired!</span>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-3">
        <div class="card card-block">
            <h4 class="card-title">Stable Release</h4>
            <ul class="list-group list-group-flush">
            <li class="list-group-item"><a href="#" target="_blank">Download 2.18.2</a></li>
            <li class="list-group-item"><a href="#" target="_blank">Manuals 2.18.2</a></li>
            </ul>
        </div>
        <div class="card card-block">
            <h4 class="card-title">Unstable Release</h4>
            <ul class="list-group list-group-flush">
            <li class="list-group-item"><a href="#" target="_blank">Download 2.19.51</a></li>
            <li class="list-group-item"><a href="#" target="_blank">Manuals 2.19.51</a></li>
            </ul>
        </div>
        <div class="card card-block">
            <h4 class="card-title">Pondings</h4>
            <p>The LilyPond Blog is up and running <a href="http://www.lilypondblog.org/" target="_blank">here</a>! Anyone can follow and leave comments on the blog. To contribute, contact <a href="mailto:ul@openlilylib.org">Urs Liska</a>.</p>
        </div>
    </div>
</div>

关于HTML- Bootstrap : Sidebar pushes main content down,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40878689/

相关文章:

javascript - 如何防止 JS 使我的 div-Container 变形?

html - IE 和 Edge 中无法解释的网格行高

php - 滚动留言板,如何链接到 div 中的 div 中的 id?

javascript - 如何在左侧制作垂直滚动条,水平滚动条应该从底部的左侧开始

jquery - 以 HTML5 形式显示 JavaScript 中的错误

java - 如何使用需要正确 HTML 的库处理来自 Web 的无效 HTML 文档

javascript - 页面上的 Twitter Bootstrap navbar-fixed-top 重新定位

jquery - 如何使 bootstrap-tour 工作?

jquery - 如何停止在页脚内容及下方显示正文内容

twitter-bootstrap - 下拉菜单在移动设备上不起作用