我需要将一个图像放在另一个图像上。
这是我的代码:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<div class = "row text-center" style="">
<div class="col-xs-6 text-center" style="background-color:none; margin-top:10px;">
<img src="1.jpg" width="250" height="250">
<img src="plus.png" width="50px" height="50px">
</div>
</div>
</body>
</html>
它是这样的:
我的实际需要是图像上的加号,如下所示:
Try this
CSS:
.product-holder {
position: relative;
display: block;
}
.plus-image {
left: 50%;
top: 50%;
position: absolute;
margin-top: -25px;
margin-left: -25px;
}
HTML
<div class = "row text-center" style="">
<div class="col-xs-6 text-center" style="background-color:none; margin-top:10px;">
<div class='product-holder'>
<img src="1.jpg" width="250" height="250" class='product-image'>
<img src="plus.png" width="50px" height="50px" class='plus-image'>
</div>
</div>
</div>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)