水平图像响应图像的叠加

Mar*_*ini 17 html css

我正在尝试在水平图库中为响应式图像创建叠加层.叠加divli具有position和大z-index值,但仍显示在图像的背景.当我尝试为absolute更高z-index的图像做图像时水平滚动失败.

看演示:Jsfiddle

html,
body {
  min-height: 100%;
  height: 100%;
}
body {
  width: 100%;
  margin: 0;
  padding: 0;
}
#thumbsList {
  height: 76%;
  white-space: nowrap;
  margin: 0;
  padding: 0;
  line-height: 0px;
  top: 13%;
  left: 80px;
  list-style-type: none;
  top: 13%;
  position: absolute;
}
#thumbsList li {
  display: inline;
  position: relative;
}
#thumbsList li img {
  max-width: 100%;
  height: 100%;
  transition: all 0.8s ease;
}
.Absolute-Center {
  margin: auto;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}
.backStrip {
  background-color: #2d2d2d;
  border-bottom: 1px solid #1a1a1a;
  height: 35px;
  position: relative;
  z-index: 22;
  position: fixed;
  width: 253px;
  top: 43px;
  height: 79px;
  left: 85px;
}
#infoText {
  color: white;
  font-style: italic;
  padding-top: 10px;
  float: right;
  margin-right: 10px;
  font-family: sans-serif;
  font-size: 12px;
}
#mainContainer {
  height: 100%;
  width: 100%;
  position: fixed;
  z-index: 1;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  border: 8px solid #2D2D2D;
  margin: 0px;
  overflow-x: auto;
}
#thumbsButtons {
  list-style: none;
  position: fixed;
  bottom: 6%;
  left: 46%;
  z-index: 22;
}
#counterContainer {
  position: fixed;
  bottom: 5%;
  left: 50%;
  right: 50%;
  font-family: verdana;
  font-weight: bold;
  width: 100px;
}
#thumbsButtons li {
  float: left;
  margin-left: 11px;
  font-size: 16px;
  font-family: verdana;
}
#thumbsButtons li:hover {
  cursor: pointer;
}
#nextArrow {
  position: fixed;
  right: 10px;
  top: 43%;
  z-index: 13333;
  font-size: 100px;
  color: white;
  font-family: helvetica;
  cursor: pointer;
}
#sidelogo {
  position: absolute;
  z-index: 10;
  top: 35%;
  left: 0%;
  width: 67px;
  height: 258px;
  background-color: #2D2D2D;
}
.headerInfo {
  position: absolute;
  bottom: 22px;
  color: white;
  z-index: 333;
  font-family: verdana;
  font-size: 17px;
  text-align: center;
}
.thumbOverlay {
  position: absolute;
  z-index: 13111133;
  background-color: black;
  color: white;
  height: 100%;
  width: 100%;
  left: 0px;
  top: 0px;
  display: inline;
}
Run Code Online (Sandbox Code Playgroud)
<div id="mainContainer">
  <div class="backStrip"> <span id="infoText">Written By Banmeet Singh</span>

  </div>
  <ul id="thumbsButtons"></ul> <span id="nextArrow">></span>
  <span id="sidelogo">Thinking Forward</span>

  <ul id="thumbsList">
    <li>
      <img class="forward" src="http://placehold.it/350x150" alt="Alternate Text" /> <span class="headerInfo">Josh Kloss</span>

    </li>
    <li>
      <div class="thumbOverlay"><span>adasd</span> 
      </div>
      <img class="forward" src="http://placehold.it/350x150" alt="Alternate Text" />
    </li>
    <li>
      <img class="forward" src="http://placehold.it/350x150" alt="Alternate Text" />
    </li>
    <li>
      <img class="forward" src="http://placehold.it/200x100" alt="Alternate Text" />
    </li>
    <li>
      <img class="forward" src="http://placehold.it/350x150" alt="Alternate Text" />
    </li>
    <li>
      <img class="forward" src="http://placehold.it/200x100" alt="Alternate Text" />
    </li>
  </ul>
  <div id="counterContainer">3 of 10</div>
Run Code Online (Sandbox Code Playgroud)

检查第二张图像.我已经添加了叠加层.

小智 2

#thumbsList li {
    display: inline-block;
    position: relative;
}
Run Code Online (Sandbox Code Playgroud)

你期待这样的结果吗?参见jsFiddle