半容器,半容器液

时间:2019-05-17 14:06:14

标签: html css twitter-bootstrap positioning

伙计们,我正在尝试实现一个布局,其中有一个带有2个列的容器,但是,正确的列需要定位在屏幕的右侧,而不是在容器的右侧...那有道理吗?

<div class="container">
    <div class="row">
        <div class="col-lg-6">
            this content is inside the container normally
        </div>
        <div class="col-lg-6">
            image will go here, but needs to be positioned to the right of the screen, not to the right of the container
        </div>
    </div>
</div>

2 个答案:

答案 0 :(得分:0)

尝试将文本放入div,然后向其添加类mr-0

答案 1 :(得分:-1)

这是您的操作方式。

Working Example

<div class=".parent">
  <div class="child">
    image will go here, but needs to be positioned to the right of the screen, not to the right of the container
  </div>
  <div class="abs">
    <div class="container">
      <div class="row">
        <div class="col-sm-6">
          this content is inside the container normallythis content is inside the container normally
        </div>
      </div>
    </div>
  </div>
</div>

.parent {
  position: relative;
}

.child {
  float: right;
  width: 50%;
  background: red;
}

.abs {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.container {
  border: 1px solid green;
}