三个div,一个右侧有全高,在flexbox中上下休息

时间:2017-06-22 14:16:17

标签: html css html5 css3 flexbox

是否可以制作三个div,一个右侧,并在flexbox 中上下休息而不更改div ?期待结果如 enter image description here

桌面视图

移动视图 enter image description here

当前工作https://codepen.io/anon/pen/jwweqr



.my-wrap {
  width: 90%;
  margin: 50px auto;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  border: 1px solid #eee;
  color: #fff;
}
.my-wrap p {
  margin: 10px;
}

.wrap-one, .wrap-two {
  width: 75%;
}

.wrap-one {
  background-color: tomato;
}

.wrap-two {
  background-color: deepskyblue;
}

.wrap-three {
  background-color: greenyellow;
  -ms-flex-preferred-size: 25%;
      flex-basis: 25%;
}

<div class="my-wrap">
  <div class="wrap-one">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Harum voluptates ipsa tempora qui voluptas, dicta corrupti dolorum, iure esse earum ut pariatur, ad possimus facilis consequatur impedit accusantium autem! Nesciunt?</p>
  </div>
  <div class="wrap-two">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat commodi aspernatur et! Voluptates officiis nemo corporis delectus pariatur. Cupiditate perspiciatis illum minima, porro voluptas velit nobis ad eveniet modi explicabo.</p>
  </div>
  <div class="wrap-three">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis reprehenderit, necessitatibus vel praesentium dolorum vitae sequi in magni voluptate alias fugit saepe eos sint dolore quae sapiente sunt itaque, cupiditate.</p>
  </div>
</div>
&#13;
&#13;
&#13;

0 个答案:

没有答案