html - 如何设置两张图片超越另一张图片?

标签 html css image

我想将两张图片放在另一张图片之外。请找到我正在尝试修复的下图。但我无法找到解决方案。

.main {
    border: 1px solid black;
    background-color: white;
    padding: 10px 10px 10px 10px;
	width: 1100px;
	height: 100%;
	margin: auto;
}
.container-fluid {
    background-image: url("bluescreen1.png");
	background-size: 100% 15%;
    background-repeat: no-repeat;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<body class="main">
<div class="container-fluid">
  <div class="row" style="z-index: 1;">
	<div class="col-sm-12">
		<img src="http://u.realgeeks.media/legacyplusrealty/email.jpg">
	</div>
  </div>
  <div class="row">
	<div class="col-sm-4">
		Some Text
	</div>
	<div class="col-sm-4">
		<img src="http://u.realgeeks.media/legacyplusrealty/email.jpg" alt="Paris" style="width: 100%; height:320px; ">
	</div>
	<div class="col-sm-4">
		<img src="http://u.realgeeks.media/legacyplusrealty/email.jpg" alt="Paris" style="width: 100%; height:320px; z-index: -100;">
	</div>
	
  </div>
</div>

</body>
enter image description here

我想要以上格式的设计。蓝色图像显示在两个图像之外。但我做不到。请审查并指导我...

最佳答案

position:relative; 添加到每个 img 中,因为 z-index 仅适用于定位元素

关于html - 如何设置两张图片超越另一张图片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43275481/

相关文章:

android - 使用相机拍摄图像并将其用作个人资料图片

iphone - 有没有办法通过浏览器通过 iPhone 捕获图片?

javascript - 保留 CSS :hover when changing CSS styles with Javascript

css - 表单中的输入和选择标签高度问题

xml - 博客文章标签和类别的 HTML5 语义标记

html - Bootstrap 在 iPad 上更改容器宽度

html - 如何删除不必要的空格

php - 如何使用 php 和 css 创建图像翻转链接

php - 在文本区域中将新行更改为 <br>

javascript - 如何将字符串值作为函数参数从html传递给javascript?