小编Thi*_*ira的帖子

固定与其父级相关的div

我有这个片段,但我需要将红色框限制为不透明的白色框.

.main {
  background-color: black;
  width: 100%;
  height: 1250px;
  position: relative;
}

.container{
  display: block;
  position: absolute;
  width: 250px;
  height: 650px;
  background: white;
}

.red-box{
  background: red;
  width: 150px;
  height: 140px;
  position: fixed;
}
Run Code Online (Sandbox Code Playgroud)
<div class="main">
  <div class="container">
    <div class="red-box">
    </div>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery css3

3
推荐指数
1
解决办法
92
查看次数

标签 统计

css ×1

css3 ×1

html ×1

javascript ×1

jquery ×1