固定位置的父母与子女,父母溢出:隐藏的错误

我不知道是否存在问题,但是我想知道为什么overflow:hidden在fixed父/子元素上不能使用。


这是一个例子:


CSS和HTML:


.parent{

  position:fixed;

  overflow:hidden;

  width:300px;

  height:300px;

  background:#555;

}

.children{

  position:fixed;

  top:200px;

  left:200px;

  width:150px;

  height:150px;

  background:#333;

}

<div class="parent">

  <div class="children">

  </div>

</div>


不负相思意
浏览 352回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP