css - Bootstrap 3 两个响应行彼此相邻?

标签 css twitter-bootstrap twitter-bootstrap-3

我正在使用 Bootstrap 3 并尝试解决图像上模拟的问题。我使用了一行和两列,它们彼此相邻,如图所示,但是当我调整大小到移动设备时,我希望右侧落在左侧下方。如有任何帮助,我们将不胜感激,谢谢。 enter image description here

代码示例:

<div className="container">
  <div className="row">
    <div className="col-xs-4 col-offset-xs-1">
     <h1>1</h1>
  </div>
  <div className="col-xs-4">
    <div className="row">
      <h1>2</h1>
    </div>
  </div>

最佳答案

.black{background-color:#000; height:320px;}
.red{background-color:#F00; height:100px;margin-bottom:10px;}
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<div class="container">
  <div class="row">
    <div class="col-xs-6">
      <div class="row">
        <div class="col-xs-12 black">
          black
        </div>
       </div>
     </div>
    <div class="col-xs-6">
      <div class="row">
        <div class="col-xs-12 red">
          one
        </div>
       </div>
      <div class="row">
        <div class="col-xs-12 red">
          two
        </div>
       </div>
      <div class="row">
        <div class="col-xs-12 red">
          three
        </div>
       </div>
     </div>
    </div>
  </div>
         

关于css - Bootstrap 3 两个响应行彼此相邻?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39744925/

相关文章:

php - 如何在固定容器中添加滚动条

html - 如果前一个元素中有元素,则隐藏文本

javascript - 无法将 "transform"添加到 css 以具有自定义 Bootstrap 模态动画

html - Bootstrap 右栏在小的时候转到上部

html - 如何阻止变换旋转扭曲字体?

css - Angular Material : no background color on mat-input on focus mode

html - 如何创建带有菜单的侧边栏和一些下拉菜单

html - input-group-addon 内的单选按钮组

twitter-bootstrap - 使用 Glyphicon 作为 LI 项目符号点 (Bootstrap 3)

javascript - Bootstrap 3 网格轮播