Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在div上重叠图像,使其一半不可见_Html_Css_Twitter Bootstrap - Fatal编程技术网

Html 在div上重叠图像,使其一半不可见

Html 在div上重叠图像,使其一半不可见,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,我想使图像70%可见粘贴在底部,其余部分不可见在div后面。我按照教程使用z-index 10位置绝对和溢出:隐藏。但图像仍然显示在另一个分区上并重叠。你能帮我吗?谢谢 HTML 如果我理解正确的话,有很多方法可以做你想做的事情(一个屏幕截图会有帮助,如果你包括“工作代码”包括一个JS提琴或代码笔链接),那么下面的例子有你的内容div和图像的工作重叠 <div class="screenshot search"> <div class="container co

我想使图像
70%可见
粘贴在
底部
,其余部分
不可见
在div后面。我按照教程使用
z-index 10
位置绝对
溢出:隐藏
。但图像仍然显示在另一个分区上并重叠。你能帮我吗?谢谢

HTML


如果我理解正确的话,有很多方法可以做你想做的事情(一个屏幕截图会有帮助,如果你包括“工作代码”包括一个JS提琴或代码笔链接),那么下面的例子有你的内容div和图像的工作重叠

  <div class="screenshot search">
      <div class="container container-fluid">
          <div class="row">
               <div class="wrap">
                   <div class="col-md-6 image-wrap">
                       <img class="img-responsive" src="http://www.navipedia.net/images/a/a9/Example.jpg" alt="pencarian"/>
                   </div>
                   <div class="col-md-6 content">
                       <h3>search</h3>
                       <p>test</p>
                   </div>
              </div>
          </div>
      </div>
  </div>

.screenshot {
    padding: 6em 0;
    height: auto;
}

.wrap {
    position:relative;
}

.screenshot img {
    width: 400px;
    max-width: 90%;
    z-index: ;
    position: absolute;
}

.image-wrap {
    overflow:hidden;
    position:relative;
    height: 200px;
}

.content {
    display:block;
    background:white;
    position:absolute;
    top:0;
    width:100%;
 }

 .search {
    background-color: #fafafa;
 }

搜索
试验

.截图{ 填充:6em0; 高度:自动; } .包裹{ 位置:相对位置; } .截图{ 宽度:400px; 最大宽度:90%; z指数:; 位置:绝对位置; } .图像包裹{ 溢出:隐藏; 位置:相对位置; 高度:200px; } .内容{ 显示:块; 背景:白色; 位置:绝对位置; 排名:0; 宽度:100%; } .搜索{ 背景色:#fafafa; }


你能给我们看一张预期结果的截图吗?另外,你能创建一个工作吗?你试过把图像作为背景(在CSS中)吗?你想用div隐藏图像的前30%吗?
        .screenshot {
      padding: 6em 0;
      height: auto;
    }

.screenshot img {
  width: 400px;
  max-width: 90%;
  z-index: 10;
  position: relative;
  overflow: hidden;
}

.search {
  background-color: #fafafa;
}
  <div class="screenshot search">
      <div class="container container-fluid">
          <div class="row">
               <div class="wrap">
                   <div class="col-md-6 image-wrap">
                       <img class="img-responsive" src="http://www.navipedia.net/images/a/a9/Example.jpg" alt="pencarian"/>
                   </div>
                   <div class="col-md-6 content">
                       <h3>search</h3>
                       <p>test</p>
                   </div>
              </div>
          </div>
      </div>
  </div>

.screenshot {
    padding: 6em 0;
    height: auto;
}

.wrap {
    position:relative;
}

.screenshot img {
    width: 400px;
    max-width: 90%;
    z-index: ;
    position: absolute;
}

.image-wrap {
    overflow:hidden;
    position:relative;
    height: 200px;
}

.content {
    display:block;
    background:white;
    position:absolute;
    top:0;
    width:100%;
 }

 .search {
    background-color: #fafafa;
 }