我想定位红色方块所在的图标。但我已经尝试过这样的立场:绝对的相对和立场,但我不明白为什么它不工作。如何将图像的一半放在div响应中
<div class="col-xs-12 col-sm-4">
<div class="wrap">
<img class="blockico" src="<?php bloginfo('template_url'); ?>/img/icons/catering150.png">
<h4>Catering</h4>
<a href="url">The Menu</a>
<br>
<a href="url">Today's Menu</a>
<br>
<a href="url">Gallery</a>
<br>
<a href="url">Festivities</a>
<br>
</div>
</div>
.wrap {
position:relative;
width: 100%;
height: 100%;
background-color: #e9e9e9;}
.blockico {
position:absolute;
top:-50%;}
尝试使用像素值,而不是像顶部:-100px;这是否工作? – StefanBob