Html css div 未显示在左侧

我面临这个问题,div 没有显示在左侧,而是显示在中间。

正如您在图像中看到的那样,白色 div 显示在中间,我需要将其显示在左侧。

https://img1.sycdn.imooc.com/65814d670001e10203350584.jpg

网页


  <div class="slide">

    <div class="first-layer">

      <div>


      </div>

    </div>

  </div>

CSS


.slide{

  background-color: #f4525e;

}


.first-layer{

  background-color: #FFFFFF;

  height: 100%;

  width: 93%;

  position:relative;

  border-bottom-right-radius: 20%;

  border-top-right-radius: 5%;

}

我也很想像这样做边界半径,但它不是


小怪兽爱吃肉
浏览 50回答 1
1回答

慕哥6287543

设置margin-left: 0;为.first-layer.slide {&nbsp; height: 500px;&nbsp; background-color: #f4525e;}.first-layer {&nbsp; background-color: #FFFFFF;&nbsp; height: 100%;&nbsp; width: 93%;&nbsp; margin-left: 0;&nbsp; position: relative;&nbsp; border-bottom-right-radius: 20%;&nbsp; border-top-right-radius: 5%;}<div class="slide">&nbsp; <div class="first-layer">&nbsp; &nbsp; <div>&nbsp; &nbsp; </div>&nbsp; </div></div>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5