css 梯形

html

<section class="teachers2">
  <div class="right-style">
    <div class="text-center img"><img src="{{ URL::asset('/') }}images/teacher_right_style.png" /></div>
  </div>
</section>

css

.teachers2 {
  padding: 10rem 0;
  background: $black;
  position: relative;
  .right-style {
    width: 34%;
    height: 100%;
    background: $light-yellow;
    position: absolute;
    right: 0;
    top: 0;
    .img {
      width: 35%;
      margin: 0 auto;
      padding-top: 14rem;
    }
    &:before {
      position: absolute;
      left: -15rem;
      top: 0;
      width: 15rem;
      height: 100%;
      content: '';
      border-bottom: 49.3rem solid $light-yellow;
      border-left: 15rem solid transparent;
    }
  }
}

猜你喜欢

转载自blog.csdn.net/tang05709/article/details/81583721
今日推荐