如何在浏览器窗口重新调整大小时,让这些图像上的标题文字四处移动?我的实现很快捷,我需要一种方法来保持文本在窗口大小调整时不会滑动。如何在响应图像上垂直居中文本?
<div class="row">
<div class="col-md-6">
<img src="http://placekitten.com/600/375" class="img-responsive" />
<h2 class="homeImageLink">
<span>Caption Text</span>
</h2>
</div>
<div class="col-md-6">
<img src="http://placekitten.com/600/375" class="img-responsive" />
<h2 class="homeImageLink">
<span>Caption Text</span>
</h2>
</div>
</div>
.homeImageLink {
position: absolute;
top: 110px;
left: 0;
text-align: center;
width: 100%;
}
.homeImageLink span {
color: red;
font-weight: 300;
font-style: italic;
text-transform: uppercase;
letter-spacing: 15px;
pointer-events: none;
}
您是否尝试过使用上的跨度COL-MD-偏移4 COL-MD-4级的? – JanR
@JanR不,我没有 - 我该如何处理垂直居中呢? – drewwyatt
是的,从头开始,它不会工作,我只是意识到你正在尝试做什么,它不会用于覆盖文本 – JanR