Bootstrap:列无法正常工作。然后我要彼此相邻

史黛西区

我的页面将各列显示为顶部,但我希望它们彼此相邻。在检查引导程序提供的内容时,我看到padding-left:15px被添加。我尝试使用它,似乎可以理解发生了什么。>。<

这是我的代码

body {
  padding-top: 70px;
}

.jumbotron {
  margin-top: -14px;
}

.primary-content {
  margin-top: 8em;
  padding-bottom: 3em;
}

.footer {
  padding-top: 4rem;
  padding-bottom: 4rem;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
  <div class="row">
    <div class="col-md-3">
      <p>An idea that started several years ago, CIMI (Carrera Internacional de la Mujer Iniciativa) is an initiative for and about women. It started as a dream of the founder, Aracely Areas, to help people like her - women with a vision for their future,
        to build confidence and motivation through running, accomplishment and in turn benefiting from the health and exercise.</p>

      <p>With the generous support of our donors, the purpose of CIMI is to foster programs and partnerships with schools and athletic associations to promote health, education, self-esteem and inspiration for women of all ages. Our goal is to sponsor yearly
        special events, providing training and educational programs, supporting health and exercise opportunities for girls and women with an emphasis on running activities and providing related training and equipment. With our younger participants, confidence
        established at an early age can be applied to all aspects of their lives, particularly in schools for bright futures. All this is offered free of any charge to our participants.</p>

      <p>We became an official Non Profit in 2015 an official 501c3 Charity. Establishing a board of directors who meet quarterly to set goals and continue to move this cause forward.</p>
    </div>
  </div>

  <div class="card mb-5 col-md-6">
    <div class="row">
      <img class="card-img-top" src="images/washingtonDCrace.jpg" alt="Card image cap">
      <div class="card-body">
        <h4 class="card-title">Mission Statement</h4>
        <p class="card-text">Focusing on women (and their family) of all ages to build confidence, promote health and motivation through accomplishment. We teach basic running skills, strength exercises, and mentoring. Through this community and confidence is built. We believe
          strongly that all people have many different abilities and strengths that when nurtured can create beautiful things.</p>
      </div>
    </div>
  </div>

  <h4>CIMI Core Values</h4>
  <div class="card mb-5 col-md-3">
    <div class="row">
      <ul class="list-group list-group-flush">
        <li class="list-group-item">Inclusion</li>
        <li class="list-group-item">Integrity</li>
        <li class="list-group-item">Determination</li>
        <li class="list-group-item">Patience</li>
      </ul>
    </div>
  </div>

</div>

达瓦尔·贾多什(Dhaval Jardosh)

根据Bootstrap Grid System,仅将1中的所有部分<div>与类一起使用,就row可以在单行中使用它们。

body {
  padding-top: 70px;
}

.jumbotron {
  margin-top: -14px;
}

.primary-content {
  margin-top: 8em;
  padding-bottom: 3em;
}

.footer {
  padding-top: 4rem;
  padding-bottom: 4rem;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
  <div class="row">
    <div class="col-md-3">
      <p>An idea that started several years ago, CIMI (Carrera Internacional de la Mujer Iniciativa) is an initiative for and about women. It started as a dream of the founder, Aracely Areas, to help people like her - women with a vision for their future,
        to build confidence and motivation through running, accomplishment and in turn benefiting from the health and exercise.</p>

      <p>With the generous support of our donors, the purpose of CIMI is to foster programs and partnerships with schools and athletic associations to promote health, education, self-esteem and inspiration for women of all ages. Our goal is to sponsor yearly
        special events, providing training and educational programs, supporting health and exercise opportunities for girls and women with an emphasis on running activities and providing related training and equipment. With our younger participants, confidence
        established at an early age can be applied to all aspects of their lives, particularly in schools for bright futures. All this is offered free of any charge to our participants.</p>

      <p>We became an official Non Profit in 2015 an official 501c3 Charity. Establishing a board of directors who meet quarterly to set goals and continue to move this cause forward.</p>
    </div>

    <div class="col-md-6">
      <img class="card-img-top" src="images/washingtonDCrace.jpg" alt="Card image cap">
      <div class="card-body">
        <h4 class="card-title">Mission Statement</h4>
        <p class="card-text">Focusing on women (and their family) of all ages to build confidence, promote health and motivation through accomplishment. We teach basic running skills, strength exercises, and mentoring. Through this community and confidence is built. We believe
          strongly that all people have many different abilities and strengths that when nurtured can create beautiful things.</p>
      </div>
    </div>

    <div class="col-md-3">
      <h4>CIMI Core Values</h4>

      <ul class="list-group list-group-flush">
        <li class="list-group-item">Inclusion</li>
        <li class="list-group-item">Integrity</li>
        <li class="list-group-item">Determination</li>
        <li class="list-group-item">Patience</li>
      </ul>
    </div>
  </div>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章