如何防止一个div内的元素从相互推搡,我有我的进度栏隐藏,直到事件(下降)被调用,我的IMG菜单始终可见CSS - 防止元素推
例如:
,你可以看到,我的进度条推了我的IMG菜单,我想他们两个我的DIV中
我怎样才能解决这个问题?
代码:
<div class="container2">
<h2>Foto en toga</h2>
<div class="PhotoContainer">
<div class="drop" id="d1">
<?php include ('inc/progressbar.php'); ?>
<?php include ('inc/imagemenu.php'); ?>
</div>
</div>
progressbar.php:
<div class="progress progress-striped active">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
<span class="sr-only">0% Complete</span>
</div>
</div>
imagemenu.php:
<div class="imgmenu">
<div class="btn btn-default custombtnview">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
</div>
<div class="btn btn-default custombtnremove">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</div>
CSS:
.drop{
border:4px dotted #bdc3c7;
padding:20px;
margin-bottom:20px;
width:200px;
height:290px;
float: left;
margin: 20px;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.imgmenu {
width: 60%;
margin-left: auto;
margin-right: auto;
margin-top: 140%;
}
.imgview {
float: left;
width: 50%;
text-align: center;
background-color: aqua;
}
.imgclear {
float: left;
width: 50%;
text-align: center;
background-color: blueviolet;
}
.progress {
margin-top: 70%;
left: 0;
}
设置位置:图像的绝对值,并相应地对齐它们。 – Frutis
为此创建一个jsfiddle。 – frnt
@fmt你可以在jsfiddle里面查看手机版吗?我不这么认为 – Frutis